finchgo

package module
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

README

Finch Go API Library

Go Reference

The Finch Go library provides convenient access to the Finch REST API from applications written in Go. The full API of this library can be found in api.md.

Installation

import (
	"github.com/Finch-API/finch-api-go" // imported as finchgo
)

Or to pin the version:

go get -u 'github.com/Finch-API/finch-api-go@v0.18.0'

Requirements

This library requires Go 1.18+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/Finch-API/finch-api-go"
	"github.com/Finch-API/finch-api-go/option"
)

func main() {
	client := finchgo.NewClient(
		option.WithAccessToken("My Access Token"),
	)
	page, err := client.HRIS.Directory.List(context.TODO(), finchgo.HRISDirectoryListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}

Request fields

All request parameters are wrapped in a generic Field type, which we use to distinguish zero values from null or omitted fields.

This prevents accidentally sending a zero value if you forget a required parameter, and enables explicitly sending null, false, '', or 0 on optional parameters. Any field not specified is not sent.

To construct fields with values, use the helpers String(), Int(), Float(), or most commonly, the generic F[T](). To send a null, use Null[T](), and to send a nonconforming value, use Raw[T](any). For example:

params := FooParams{
	Name: finchgo.F("hello"),

	// Explicitly send `"description": null`
	Description: finchgo.Null[string](),

	Point: finchgo.F(finchgo.Point{
		X: finchgo.Int(0),
		Y: finchgo.Int(1),

		// In cases where the API specifies a given type,
		// but you want to send something else, use `Raw`:
		Z: finchgo.Raw[int64](0.01), // sends a float
	}),
}
Response objects

All fields in response structs are value types (not pointers or wrappers).

If a given field is null, not present, or invalid, the corresponding field will simply be its zero value.

All response structs also include a special JSON field, containing more detailed information about each property, which you can use like so:

if res.Name == "" {
	// true if `"name"` is either not present or explicitly null
	res.JSON.Name.IsNull()

	// true if the `"name"` key was not present in the repsonse JSON at all
	res.JSON.Name.IsMissing()

	// When the API returns data that cannot be coerced to the expected type:
	if res.JSON.Name.IsInvalid() {
		raw := res.JSON.Name.Raw()

		legacyName := struct{
			First string `json:"first"`
			Last  string `json:"last"`
		}{}
		json.Unmarshal([]byte(raw), &legacyName)
		name = legacyName.First + " " + legacyName.Last
	}
}

These .JSON structs also include an Extras map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := finchgo.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.HRIS.Directory.List(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

iter := client.HRIS.Directory.ListAutoPaging(context.TODO(), finchgo.HRISDirectoryListParams{})
// Automatically fetches more pages as needed.
for iter.Next() {
	individualInDirectory := iter.Current()
	fmt.Printf("%+v\n", individualInDirectory)
}
if err := iter.Err(); err != nil {
	panic(err.Error())
}

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

page, err := client.HRIS.Directory.List(context.TODO(), finchgo.HRISDirectoryListParams{})
for page != nil {
	for _, directory := range page.Individuals {
		fmt.Printf("%+v\n", directory)
	}
	page, err = page.GetNextPage()
}
if err != nil {
	panic(err.Error())
}
Errors

When the API returns a non-success status code, we return an error with type *finchgo.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.HRIS.Company.Get(context.TODO())
if err != nil {
	var apierr *finchgo.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/employer/company": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.HRIS.Directory.List(
	ctx,
	finchgo.HRISDirectoryListParams{},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as param.Field[io.Reader]. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper finchgo.FileParam(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := finchgo.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.HRIS.Directory.List(
	context.TODO(),
	finchgo.HRISDirectoryListParams{},
	option.WithMaxRetries(5),
)
Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := finchgo.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. 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).
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Documentation

Index

Constants

View Source
const ConnectionStatusTypeConnected = shared.ConnectionStatusTypeConnected

This is an alias to an internal value.

View Source
const ConnectionStatusTypeErrorNoAccountSetup = shared.ConnectionStatusTypeErrorNoAccountSetup

This is an alias to an internal value.

View Source
const ConnectionStatusTypeErrorPermissions = shared.ConnectionStatusTypeErrorPermissions

This is an alias to an internal value.

View Source
const ConnectionStatusTypePending = shared.ConnectionStatusTypePending

This is an alias to an internal value.

View Source
const ConnectionStatusTypeProcessing = shared.ConnectionStatusTypeProcessing

This is an alias to an internal value.

View Source
const ConnectionStatusTypeReauth = shared.ConnectionStatusTypeReauth

This is an alias to an internal value.

View Source
const OperationSupportClientAccessOnly = shared.OperationSupportClientAccessOnly

This is an alias to an internal value.

View Source
const OperationSupportNotSupportedByFinch = shared.OperationSupportNotSupportedByFinch

This is an alias to an internal value.

View Source
const OperationSupportNotSupportedByProvider = shared.OperationSupportNotSupportedByProvider

This is an alias to an internal value.

View Source
const OperationSupportSupported = shared.OperationSupportSupported

This is an alias to an internal value.

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) param.Field[bool]

Bool is a param field helper which helps specify bools.

func F

func F[T any](value T) param.Field[T]

F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.

func FileParam added in v0.16.0

func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]

FileParam is a param field helper which helps files with a mime content-type.

func Float

func Float(value float64) param.Field[float64]

Float is a param field helper which helps specify floats.

func Int

func Int(value int64) param.Field[int64]

Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.

func Null

func Null[T any]() param.Field[T]

Null is a param field helper which explicitly sends null to the API.

func Raw

func Raw[T any](value any) param.Field[T]

Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).

func String

func String(value string) param.Field[string]

String is a param field helper which helps specify strings.

Types

type AccessTokenNewParams added in v0.8.0

type AccessTokenNewParams struct {
	Code         param.Field[string] `json:"code,required"`
	ClientID     param.Field[string] `json:"client_id"`
	ClientSecret param.Field[string] `json:"client_secret"`
	RedirectUri  param.Field[string] `json:"redirect_uri"`
}

func (AccessTokenNewParams) MarshalJSON added in v0.8.0

func (r AccessTokenNewParams) MarshalJSON() (data []byte, err error)

type AccessTokenService added in v0.8.0

type AccessTokenService struct {
	Options []option.RequestOption
}

AccessTokenService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAccessTokenService method instead.

func NewAccessTokenService added in v0.8.0

func NewAccessTokenService(opts ...option.RequestOption) (r *AccessTokenService)

NewAccessTokenService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AccessTokenService) New added in v0.8.0

Exchange the authorization code for an access token

type AccountService

type AccountService struct {
	Options []option.RequestOption
}

AccountService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAccountService method instead.

func NewAccountService

func NewAccountService(opts ...option.RequestOption) (r *AccountService)

NewAccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AccountService) Disconnect

func (r *AccountService) Disconnect(ctx context.Context, opts ...option.RequestOption) (res *DisconnectResponse, err error)

Disconnect one or more `access_token`s from your application.

func (*AccountService) Introspect

func (r *AccountService) Introspect(ctx context.Context, opts ...option.RequestOption) (res *Introspection, err error)

Read account information associated with an `access_token`

type AccountUpdateEvent added in v0.10.0

type AccountUpdateEvent struct {
	Data      AccountUpdateEventData      `json:"data"`
	EventType AccountUpdateEventEventType `json:"event_type"`
	JSON      accountUpdateEventJSON      `json:"-"`
	BaseWebhookEvent
}

func (*AccountUpdateEvent) UnmarshalJSON added in v0.10.0

func (r *AccountUpdateEvent) UnmarshalJSON(data []byte) (err error)

type AccountUpdateEventData added in v0.10.0

type AccountUpdateEventData struct {
	AuthenticationMethod AccountUpdateEventDataAuthenticationMethod `json:"authentication_method,required"`
	Status               shared.ConnectionStatusType                `json:"status,required"`
	JSON                 accountUpdateEventDataJSON                 `json:"-"`
}

func (*AccountUpdateEventData) UnmarshalJSON added in v0.10.0

func (r *AccountUpdateEventData) UnmarshalJSON(data []byte) (err error)

type AccountUpdateEventDataAuthenticationMethod added in v0.10.0

type AccountUpdateEventDataAuthenticationMethod struct {
	// Each benefit type and their supported features. If the benefit type is not
	// supported, the property will be null
	BenefitsSupport BenefitsSupport `json:"benefits_support,nullable"`
	// The supported data fields returned by our HR and payroll endpoints
	SupportedFields AccountUpdateEventDataAuthenticationMethodSupportedFields `json:"supported_fields,nullable"`
	// The type of authentication method.
	Type AccountUpdateEventDataAuthenticationMethodType `json:"type"`
	JSON accountUpdateEventDataAuthenticationMethodJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethod) UnmarshalJSON added in v0.10.0

func (r *AccountUpdateEventDataAuthenticationMethod) UnmarshalJSON(data []byte) (err error)

type AccountUpdateEventDataAuthenticationMethodSupportedFields added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFields struct {
	Company      AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompany      `json:"company"`
	Directory    AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectory    `json:"directory"`
	Employment   AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmployment   `json:"employment"`
	Individual   AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividual   `json:"individual"`
	PayStatement AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatement `json:"pay_statement"`
	Payment      AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayment      `json:"payment"`
	JSON         accountUpdateEventDataAuthenticationMethodSupportedFieldsJSON         `json:"-"`
}

The supported data fields returned by our HR and payroll endpoints

func (*AccountUpdateEventDataAuthenticationMethodSupportedFields) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompany added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompany struct {
	ID                 bool                                                                        `json:"id"`
	Accounts           AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyAccounts    `json:"accounts"`
	Departments        AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyDepartments `json:"departments"`
	Ein                bool                                                                        `json:"ein"`
	Entity             AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyEntity      `json:"entity"`
	LegalName          bool                                                                        `json:"legal_name"`
	Locations          AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyLocations   `json:"locations"`
	PrimaryEmail       bool                                                                        `json:"primary_email"`
	PrimaryPhoneNumber bool                                                                        `json:"primary_phone_number"`
	JSON               accountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyJSON        `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompany) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyAccounts added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyAccounts struct {
	AccountName     bool                                                                         `json:"account_name"`
	AccountNumber   bool                                                                         `json:"account_number"`
	AccountType     bool                                                                         `json:"account_type"`
	InstitutionName bool                                                                         `json:"institution_name"`
	RoutingNumber   bool                                                                         `json:"routing_number"`
	JSON            accountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyAccountsJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyAccounts) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyDepartments added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyDepartments struct {
	Name   bool                                                                              `json:"name"`
	Parent AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyDepartmentsParent `json:"parent"`
	JSON   accountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyDepartmentsJSON   `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyDepartments) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyDepartmentsParent added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyDepartmentsParent struct {
	Name bool                                                                                  `json:"name"`
	JSON accountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyDepartmentsParentJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyDepartmentsParent) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyEntity added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyEntity struct {
	Subtype bool                                                                       `json:"subtype"`
	Type    bool                                                                       `json:"type"`
	JSON    accountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyEntityJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyEntity) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyLocations added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyLocations struct {
	City       bool                                                                          `json:"city"`
	Country    bool                                                                          `json:"country"`
	Line1      bool                                                                          `json:"line1"`
	Line2      bool                                                                          `json:"line2"`
	PostalCode bool                                                                          `json:"postal_code"`
	State      bool                                                                          `json:"state"`
	JSON       accountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyLocationsJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsCompanyLocations) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectory added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectory struct {
	Individuals AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryIndividuals `json:"individuals"`
	Paging      AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryPaging      `json:"paging"`
	JSON        accountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryJSON        `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectory) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryIndividuals added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryIndividuals struct {
	ID         bool                                                                                 `json:"id"`
	Department bool                                                                                 `json:"department"`
	FirstName  bool                                                                                 `json:"first_name"`
	IsActive   bool                                                                                 `json:"is_active"`
	LastName   bool                                                                                 `json:"last_name"`
	Manager    AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryIndividualsManager `json:"manager"`
	MiddleName bool                                                                                 `json:"middle_name"`
	JSON       accountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryIndividualsJSON    `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryIndividuals) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryIndividualsManager added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryIndividualsManager struct {
	ID   bool                                                                                     `json:"id"`
	JSON accountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryIndividualsManagerJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryIndividualsManager) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryPaging added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryPaging struct {
	Count  bool                                                                         `json:"count"`
	Offset bool                                                                         `json:"offset"`
	JSON   accountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryPagingJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsDirectoryPaging) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmployment added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmployment struct {
	ID            bool                                                                          `json:"id"`
	ClassCode     bool                                                                          `json:"class_code"`
	CustomFields  bool                                                                          `json:"custom_fields"`
	Department    AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentDepartment `json:"department"`
	Employment    AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentEmployment `json:"employment"`
	EndDate       bool                                                                          `json:"end_date"`
	FirstName     bool                                                                          `json:"first_name"`
	Income        AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentIncome     `json:"income"`
	IncomeHistory bool                                                                          `json:"income_history"`
	IsActive      bool                                                                          `json:"is_active"`
	LastName      bool                                                                          `json:"last_name"`
	Location      AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentLocation   `json:"location"`
	Manager       AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentManager    `json:"manager"`
	MiddleName    bool                                                                          `json:"middle_name"`
	StartDate     bool                                                                          `json:"start_date"`
	Title         bool                                                                          `json:"title"`
	JSON          accountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentJSON       `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmployment) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentDepartment added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentDepartment struct {
	Name bool                                                                              `json:"name"`
	JSON accountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentDepartmentJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentDepartment) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentEmployment added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentEmployment struct {
	Subtype bool                                                                              `json:"subtype"`
	Type    bool                                                                              `json:"type"`
	JSON    accountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentEmploymentJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentEmployment) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentIncome added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentIncome struct {
	Amount   bool                                                                          `json:"amount"`
	Currency bool                                                                          `json:"currency"`
	Unit     bool                                                                          `json:"unit"`
	JSON     accountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentIncomeJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentIncome) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentLocation added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentLocation struct {
	City       bool                                                                            `json:"city"`
	Country    bool                                                                            `json:"country"`
	Line1      bool                                                                            `json:"line1"`
	Line2      bool                                                                            `json:"line2"`
	PostalCode bool                                                                            `json:"postal_code"`
	State      bool                                                                            `json:"state"`
	JSON       accountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentLocationJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentLocation) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentManager added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentManager struct {
	ID   bool                                                                           `json:"id"`
	JSON accountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentManagerJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsEmploymentManager) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividual added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividual struct {
	ID            bool                                                                            `json:"id"`
	Dob           bool                                                                            `json:"dob"`
	Emails        AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualEmails       `json:"emails"`
	EncryptedSsn  bool                                                                            `json:"encrypted_ssn"`
	Ethnicity     bool                                                                            `json:"ethnicity"`
	FirstName     bool                                                                            `json:"first_name"`
	Gender        bool                                                                            `json:"gender"`
	LastName      bool                                                                            `json:"last_name"`
	MiddleName    bool                                                                            `json:"middle_name"`
	PhoneNumbers  AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualPhoneNumbers `json:"phone_numbers"`
	PreferredName bool                                                                            `json:"preferred_name"`
	Residence     AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualResidence    `json:"residence"`
	Ssn           bool                                                                            `json:"ssn"`
	JSON          accountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualJSON         `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividual) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualEmails added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualEmails struct {
	Data bool                                                                          `json:"data"`
	Type bool                                                                          `json:"type"`
	JSON accountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualEmailsJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualEmails) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualPhoneNumbers added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualPhoneNumbers struct {
	Data bool                                                                                `json:"data"`
	Type bool                                                                                `json:"type"`
	JSON accountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualPhoneNumbersJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualPhoneNumbers) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualResidence added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualResidence struct {
	City       bool                                                                             `json:"city"`
	Country    bool                                                                             `json:"country"`
	Line1      bool                                                                             `json:"line1"`
	Line2      bool                                                                             `json:"line2"`
	PostalCode bool                                                                             `json:"postal_code"`
	State      bool                                                                             `json:"state"`
	JSON       accountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualResidenceJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsIndividualResidence) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatement added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatement struct {
	Paging        AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPaging        `json:"paging"`
	PayStatements AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatements `json:"pay_statements"`
	JSON          accountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementJSON          `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatement) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPaging added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPaging struct {
	Count  bool                                                                            `json:"count,required"`
	Offset bool                                                                            `json:"offset,required"`
	JSON   accountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPagingJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPaging) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatements added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatements struct {
	Earnings              AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEarnings              `json:"earnings"`
	EmployeeDeductions    AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployeeDeductions    `json:"employee_deductions"`
	EmployerContributions AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerContributions `json:"employer_contributions"`
	// [DEPRECATED] Use `employer_contributions` instead
	EmployerDeductions AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerDeductions `json:"employer_deductions"`
	GrossPay           bool                                                                                                 `json:"gross_pay"`
	IndividualID       bool                                                                                                 `json:"individual_id"`
	NetPay             bool                                                                                                 `json:"net_pay"`
	PaymentMethod      bool                                                                                                 `json:"payment_method"`
	Taxes              AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsTaxes              `json:"taxes"`
	TotalHours         bool                                                                                                 `json:"total_hours"`
	Type               bool                                                                                                 `json:"type"`
	JSON               accountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsJSON               `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatements) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEarnings added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEarnings struct {
	Amount   bool                                                                                           `json:"amount"`
	Currency bool                                                                                           `json:"currency"`
	Name     bool                                                                                           `json:"name"`
	Type     bool                                                                                           `json:"type"`
	JSON     accountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEarningsJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEarnings) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployeeDeductions added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployeeDeductions struct {
	Amount   bool                                                                                                     `json:"amount"`
	Currency bool                                                                                                     `json:"currency"`
	Name     bool                                                                                                     `json:"name"`
	PreTax   bool                                                                                                     `json:"pre_tax"`
	Type     bool                                                                                                     `json:"type"`
	JSON     accountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployeeDeductionsJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployeeDeductions) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerContributions added in v0.10.1

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerContributions struct {
	Amount   bool                                                                                                        `json:"amount"`
	Currency bool                                                                                                        `json:"currency"`
	Name     bool                                                                                                        `json:"name"`
	JSON     accountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerContributionsJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerContributions) UnmarshalJSON added in v0.10.1

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerDeductions added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerDeductions struct {
	Amount   bool                                                                                                     `json:"amount"`
	Currency bool                                                                                                     `json:"currency"`
	Name     bool                                                                                                     `json:"name"`
	JSON     accountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerDeductionsJSON `json:"-"`
}

[DEPRECATED] Use `employer_contributions` instead

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerDeductions) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsTaxes added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsTaxes struct {
	Amount   bool                                                                                        `json:"amount"`
	Currency bool                                                                                        `json:"currency"`
	Employer bool                                                                                        `json:"employer"`
	Name     bool                                                                                        `json:"name"`
	Type     bool                                                                                        `json:"type"`
	JSON     accountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsTaxesJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayStatementPayStatementsTaxes) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayment added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayment struct {
	ID            bool                                                                      `json:"id"`
	CompanyDebit  bool                                                                      `json:"company_debit"`
	DebitDate     bool                                                                      `json:"debit_date"`
	EmployeeTaxes bool                                                                      `json:"employee_taxes"`
	EmployerTaxes bool                                                                      `json:"employer_taxes"`
	GrossPay      bool                                                                      `json:"gross_pay"`
	IndividualIDs bool                                                                      `json:"individual_ids"`
	NetPay        bool                                                                      `json:"net_pay"`
	PayDate       bool                                                                      `json:"pay_date"`
	PayPeriod     AccountUpdateEventDataAuthenticationMethodSupportedFieldsPaymentPayPeriod `json:"pay_period"`
	JSON          accountUpdateEventDataAuthenticationMethodSupportedFieldsPaymentJSON      `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsPayment) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPaymentPayPeriod added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodSupportedFieldsPaymentPayPeriod struct {
	EndDate   bool                                                                          `json:"end_date"`
	StartDate bool                                                                          `json:"start_date"`
	JSON      accountUpdateEventDataAuthenticationMethodSupportedFieldsPaymentPayPeriodJSON `json:"-"`
}

func (*AccountUpdateEventDataAuthenticationMethodSupportedFieldsPaymentPayPeriod) UnmarshalJSON added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodType added in v0.10.0

type AccountUpdateEventDataAuthenticationMethodType string

The type of authentication method.

const (
	AccountUpdateEventDataAuthenticationMethodTypeAssisted      AccountUpdateEventDataAuthenticationMethodType = "assisted"
	AccountUpdateEventDataAuthenticationMethodTypeCredential    AccountUpdateEventDataAuthenticationMethodType = "credential"
	AccountUpdateEventDataAuthenticationMethodTypeAPIToken      AccountUpdateEventDataAuthenticationMethodType = "api_token"
	AccountUpdateEventDataAuthenticationMethodTypeAPICredential AccountUpdateEventDataAuthenticationMethodType = "api_credential"
	AccountUpdateEventDataAuthenticationMethodTypeOAuth         AccountUpdateEventDataAuthenticationMethodType = "oauth"
)

func (AccountUpdateEventDataAuthenticationMethodType) IsKnown added in v0.16.0

type AccountUpdateEventEventType added in v0.10.0

type AccountUpdateEventEventType string
const (
	AccountUpdateEventEventTypeAccountUpdated AccountUpdateEventEventType = "account.updated"
)

func (AccountUpdateEventEventType) IsKnown added in v0.16.0

func (r AccountUpdateEventEventType) IsKnown() bool

type AutomatedAsyncJob added in v0.7.0

type AutomatedAsyncJob struct {
	// The datetime the job completed.
	CompletedAt time.Time `json:"completed_at,required,nullable" format:"date-time"`
	// The datetime when the job was created. for scheduled jobs, this will be the
	// initial connection time. For ad-hoc jobs, this will be the time the creation
	// request was received.
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The id of the job that has been created.
	JobID string `json:"job_id,required" format:"uuid"`
	// The url that can be used to retrieve the job status
	JobURL string `json:"job_url,required"`
	// The datetime a job is scheduled to be run. For scheduled jobs, this datetime can
	// be in the future if the job has not yet been enqueued. For ad-hoc jobs, this
	// field will be null.
	ScheduledAt time.Time `json:"scheduled_at,required,nullable" format:"date-time"`
	// The datetime a job entered into the job queue.
	StartedAt time.Time               `json:"started_at,required,nullable" format:"date-time"`
	Status    AutomatedAsyncJobStatus `json:"status,required"`
	// Only `data_sync_all` currently supported
	Type AutomatedAsyncJobType `json:"type,required"`
	JSON automatedAsyncJobJSON `json:"-"`
}

func (*AutomatedAsyncJob) UnmarshalJSON added in v0.7.0

func (r *AutomatedAsyncJob) UnmarshalJSON(data []byte) (err error)

type AutomatedAsyncJobStatus added in v0.7.0

type AutomatedAsyncJobStatus string
const (
	AutomatedAsyncJobStatusPending          AutomatedAsyncJobStatus = "pending"
	AutomatedAsyncJobStatusInProgress       AutomatedAsyncJobStatus = "in_progress"
	AutomatedAsyncJobStatusComplete         AutomatedAsyncJobStatus = "complete"
	AutomatedAsyncJobStatusError            AutomatedAsyncJobStatus = "error"
	AutomatedAsyncJobStatusReauthError      AutomatedAsyncJobStatus = "reauth_error"
	AutomatedAsyncJobStatusPermissionsError AutomatedAsyncJobStatus = "permissions_error"
)

func (AutomatedAsyncJobStatus) IsKnown added in v0.16.0

func (r AutomatedAsyncJobStatus) IsKnown() bool

type AutomatedAsyncJobType added in v0.7.0

type AutomatedAsyncJobType string

Only `data_sync_all` currently supported

const (
	AutomatedAsyncJobTypeDataSyncAll AutomatedAsyncJobType = "data_sync_all"
)

func (AutomatedAsyncJobType) IsKnown added in v0.16.0

func (r AutomatedAsyncJobType) IsKnown() bool

type BaseWebhookEvent added in v0.10.0

type BaseWebhookEvent struct {
	// Unique Finch id of the employer account that was used to make this connection.
	AccountID string `json:"account_id,required"`
	// Unique Finch id of the company for which data has been updated.
	CompanyID string               `json:"company_id,required"`
	JSON      baseWebhookEventJSON `json:"-"`
}

func (*BaseWebhookEvent) UnmarshalJSON added in v0.10.0

func (r *BaseWebhookEvent) UnmarshalJSON(data []byte) (err error)

type BenefitContribution added in v0.0.7

type BenefitContribution struct {
	// Contribution amount in cents (if `fixed`) or basis points (if `percent`).
	Amount int64 `json:"amount,nullable"`
	// Contribution type.
	Type BenefitContributionType `json:"type,nullable"`
	JSON benefitContributionJSON `json:"-"`
}

func (*BenefitContribution) UnmarshalJSON added in v0.0.7

func (r *BenefitContribution) UnmarshalJSON(data []byte) (err error)

type BenefitContributionType added in v0.0.7

type BenefitContributionType string

Contribution type.

const (
	BenefitContributionTypeFixed   BenefitContributionType = "fixed"
	BenefitContributionTypePercent BenefitContributionType = "percent"
)

func (BenefitContributionType) IsKnown added in v0.16.0

func (r BenefitContributionType) IsKnown() bool

type BenefitFeaturesAndOperations added in v0.5.0

type BenefitFeaturesAndOperations struct {
	SupportedFeatures   BenefitFeaturesAndOperationsSupportedFeatures `json:"supported_features"`
	SupportedOperations SupportPerBenefitType                         `json:"supported_operations"`
	JSON                benefitFeaturesAndOperationsJSON              `json:"-"`
}

func (*BenefitFeaturesAndOperations) UnmarshalJSON added in v0.5.0

func (r *BenefitFeaturesAndOperations) UnmarshalJSON(data []byte) (err error)

type BenefitFeaturesAndOperationsSupportedFeatures added in v0.5.0

type BenefitFeaturesAndOperationsSupportedFeatures struct {
	// Whether the provider supports an annual maximum for this benefit.
	AnnualMaximum bool `json:"annual_maximum,nullable"`
	// Whether the provider supports catch up for this benefit. This field will only be
	// true for retirement benefits.
	CatchUp bool `json:"catch_up,nullable"`
	// Supported contribution types. An empty array indicates contributions are not
	// supported.
	CompanyContribution []BenefitFeaturesAndOperationsSupportedFeaturesCompanyContribution `json:"company_contribution,nullable"`
	Description         string                                                             `json:"description,nullable"`
	// Supported deduction types. An empty array indicates deductions are not
	// supported.
	EmployeeDeduction []BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeduction `json:"employee_deduction,nullable"`
	// The list of frequencies supported by the provider for this benefit
	Frequencies []BenefitFrequency `json:"frequencies"`
	// Whether the provider supports HSA contribution limits. Empty if this feature is
	// not supported for the benefit. This array only has values for HSA benefits.
	HsaContributionLimit []BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimit `json:"hsa_contribution_limit,nullable"`
	JSON                 benefitFeaturesAndOperationsSupportedFeaturesJSON                   `json:"-"`
}

func (*BenefitFeaturesAndOperationsSupportedFeatures) UnmarshalJSON added in v0.5.0

func (r *BenefitFeaturesAndOperationsSupportedFeatures) UnmarshalJSON(data []byte) (err error)

type BenefitFeaturesAndOperationsSupportedFeaturesCompanyContribution added in v0.5.0

type BenefitFeaturesAndOperationsSupportedFeaturesCompanyContribution string
const (
	BenefitFeaturesAndOperationsSupportedFeaturesCompanyContributionFixed   BenefitFeaturesAndOperationsSupportedFeaturesCompanyContribution = "fixed"
	BenefitFeaturesAndOperationsSupportedFeaturesCompanyContributionPercent BenefitFeaturesAndOperationsSupportedFeaturesCompanyContribution = "percent"
)

func (BenefitFeaturesAndOperationsSupportedFeaturesCompanyContribution) IsKnown added in v0.16.0

type BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeduction added in v0.5.0

type BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeduction string
const (
	BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeductionFixed   BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeduction = "fixed"
	BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeductionPercent BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeduction = "percent"
)

func (BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeduction) IsKnown added in v0.16.0

type BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimit added in v0.5.0

type BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimit string
const (
	BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimitIndividual BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimit = "individual"
	BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimitFamily     BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimit = "family"
)

func (BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimit) IsKnown added in v0.16.0

type BenefitFrequency

type BenefitFrequency string
const (
	BenefitFrequencyOneTime       BenefitFrequency = "one_time"
	BenefitFrequencyEveryPaycheck BenefitFrequency = "every_paycheck"
	BenefitFrequencyMonthly       BenefitFrequency = "monthly"
)

func (BenefitFrequency) IsKnown added in v0.16.0

func (r BenefitFrequency) IsKnown() bool

type BenefitType

type BenefitType string

Type of benefit.

const (
	BenefitType_401k            BenefitType = "401k"
	BenefitType_401kRoth        BenefitType = "401k_roth"
	BenefitType_401kLoan        BenefitType = "401k_loan"
	BenefitType_403b            BenefitType = "403b"
	BenefitType_403bRoth        BenefitType = "403b_roth"
	BenefitType_457             BenefitType = "457"
	BenefitType_457Roth         BenefitType = "457_roth"
	BenefitTypeS125Medical      BenefitType = "s125_medical"
	BenefitTypeS125Dental       BenefitType = "s125_dental"
	BenefitTypeS125Vision       BenefitType = "s125_vision"
	BenefitTypeHsaPre           BenefitType = "hsa_pre"
	BenefitTypeHsaPost          BenefitType = "hsa_post"
	BenefitTypeFsaMedical       BenefitType = "fsa_medical"
	BenefitTypeFsaDependentCare BenefitType = "fsa_dependent_care"
	BenefitTypeSimpleIRA        BenefitType = "simple_ira"
	BenefitTypeSimple           BenefitType = "simple"
	BenefitTypeCommuter         BenefitType = "commuter"
	BenefitTypeCustomPostTax    BenefitType = "custom_post_tax"
	BenefitTypeCustomPreTax     BenefitType = "custom_pre_tax"
)

func (BenefitType) IsKnown added in v0.16.0

func (r BenefitType) IsKnown() bool

type BenefitsSupport added in v0.5.0

type BenefitsSupport struct {
	Commuter         BenefitFeaturesAndOperations            `json:"commuter,nullable"`
	CustomPostTax    BenefitFeaturesAndOperations            `json:"custom_post_tax,nullable"`
	CustomPreTax     BenefitFeaturesAndOperations            `json:"custom_pre_tax,nullable"`
	FsaDependentCare BenefitFeaturesAndOperations            `json:"fsa_dependent_care,nullable"`
	FsaMedical       BenefitFeaturesAndOperations            `json:"fsa_medical,nullable"`
	HsaPost          BenefitFeaturesAndOperations            `json:"hsa_post,nullable"`
	HsaPre           BenefitFeaturesAndOperations            `json:"hsa_pre,nullable"`
	S125Dental       BenefitFeaturesAndOperations            `json:"s125_dental,nullable"`
	S125Medical      BenefitFeaturesAndOperations            `json:"s125_medical,nullable"`
	S125Vision       BenefitFeaturesAndOperations            `json:"s125_vision,nullable"`
	Simple           BenefitFeaturesAndOperations            `json:"simple,nullable"`
	SimpleIRA        BenefitFeaturesAndOperations            `json:"simple_ira,nullable"`
	ExtraFields      map[string]BenefitFeaturesAndOperations `json:"-,extras"`
	JSON             benefitsSupportJSON                     `json:"-"`
}

Each benefit type and their supported features. If the benefit type is not supported, the property will be null

func (*BenefitsSupport) UnmarshalJSON added in v0.5.0

func (r *BenefitsSupport) UnmarshalJSON(data []byte) (err error)

type Client

type Client struct {
	Options           []option.RequestOption
	AccessTokens      *AccessTokenService
	HRIS              *HRISService
	Providers         *ProviderService
	Account           *AccountService
	Webhooks          *WebhookService
	RequestForwarding *RequestForwardingService
	Jobs              *JobService
	Sandbox           *SandboxService
}

Client creates a struct with services and top level methods that help with interacting with the Finch API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r *Client)

NewClient generates a new client with the default option read from the environment (FINCH_CLIENT_ID, FINCH_CLIENT_SECRET, FINCH_SANDBOX_CLIENT_ID, FINCH_SANDBOX_CLIENT_SECRET, FINCH_WEBHOOK_SECRET). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete added in v0.16.0

func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute added in v0.16.0

func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get added in v0.16.0

func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) GetAccessToken added in v0.7.0

func (r *Client) GetAccessToken(ctx context.Context, code string, redirectUri string, opts ...option.RequestOption) (res string, err error)

DEPRECATED: use client.accessTokens().create instead.

func (*Client) GetAuthURL added in v0.7.0

func (r *Client) GetAuthURL(products string, redirectUri string, sandbox bool, opts ...option.RequestOption) (res string, err error)

Returns the authorization URL which can be visited in order to obtain an authorization code from Finch. The authorization code can then be exchanged for an access token for the Finch API by calling getAccessToken().

func (*Client) Patch added in v0.16.0

func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post added in v0.16.0

func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put added in v0.16.0

func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) WithAccessToken added in v0.8.0

func (r *Client) WithAccessToken(accessToken string) (res Client, err error)

Returns a copy of the current Finch client with the given access token for authentication.

type Company

type Company struct {
	// A stable Finch `id` (UUID v4) for the company.
	ID string `json:"id,required"`
	// An array of bank account objects associated with the payroll/HRIS system.
	Accounts []CompanyAccount `json:"accounts,required,nullable"`
	// The array of company departments.
	Departments []CompanyDepartment `json:"departments,required,nullable"`
	// The employer identification number.
	Ein string `json:"ein,required,nullable"`
	// The entity type object.
	Entity CompanyEntity `json:"entity,required,nullable"`
	// The legal name of the company.
	LegalName string     `json:"legal_name,required,nullable"`
	Locations []Location `json:"locations,required,nullable"`
	// The email of the main administrator on the account.
	PrimaryEmail string `json:"primary_email,required,nullable"`
	// The phone number of the main administrator on the account. Format: `XXXXXXXXXX`
	PrimaryPhoneNumber string      `json:"primary_phone_number,required,nullable"`
	JSON               companyJSON `json:"-"`
}

func (*Company) UnmarshalJSON

func (r *Company) UnmarshalJSON(data []byte) (err error)

type CompanyAccount

type CompanyAccount struct {
	// The name of the bank associated in the payroll/HRIS system.
	AccountName string `json:"account_name,nullable"`
	// 10-12 digit number to specify the bank account
	AccountNumber string `json:"account_number,nullable"`
	// The type of bank account.
	AccountType CompanyAccountsAccountType `json:"account_type,nullable"`
	// Name of the banking institution.
	InstitutionName string `json:"institution_name,nullable"`
	// A nine-digit code that's based on the U.S. Bank location where your account was
	// opened.
	RoutingNumber string             `json:"routing_number,nullable"`
	JSON          companyAccountJSON `json:"-"`
}

func (*CompanyAccount) UnmarshalJSON

func (r *CompanyAccount) UnmarshalJSON(data []byte) (err error)

type CompanyAccountsAccountType

type CompanyAccountsAccountType string

The type of bank account.

const (
	CompanyAccountsAccountTypeChecking CompanyAccountsAccountType = "checking"
	CompanyAccountsAccountTypeSavings  CompanyAccountsAccountType = "savings"
)

func (CompanyAccountsAccountType) IsKnown added in v0.16.0

func (r CompanyAccountsAccountType) IsKnown() bool

type CompanyBenefit

type CompanyBenefit struct {
	BenefitID           string              `json:"benefit_id,required"`
	CompanyContribution BenefitContribution `json:"company_contribution,required,nullable"`
	Description         string              `json:"description,required,nullable"`
	EmployeeDeduction   BenefitContribution `json:"employee_deduction,required,nullable"`
	Frequency           BenefitFrequency    `json:"frequency,required,nullable"`
	// Type of benefit.
	Type BenefitType        `json:"type,required,nullable"`
	JSON companyBenefitJSON `json:"-"`
}

func (*CompanyBenefit) UnmarshalJSON

func (r *CompanyBenefit) UnmarshalJSON(data []byte) (err error)

type CompanyDepartment

type CompanyDepartment struct {
	// The department name.
	Name string `json:"name,nullable"`
	// The parent department, if present.
	Parent CompanyDepartmentsParent `json:"parent,nullable"`
	JSON   companyDepartmentJSON    `json:"-"`
}

func (*CompanyDepartment) UnmarshalJSON

func (r *CompanyDepartment) UnmarshalJSON(data []byte) (err error)

type CompanyDepartmentsParent

type CompanyDepartmentsParent struct {
	// The parent department's name.
	Name string                       `json:"name,nullable"`
	JSON companyDepartmentsParentJSON `json:"-"`
}

The parent department, if present.

func (*CompanyDepartmentsParent) UnmarshalJSON

func (r *CompanyDepartmentsParent) UnmarshalJSON(data []byte) (err error)

type CompanyEntity

type CompanyEntity struct {
	// The tax payer subtype of the company.
	Subtype CompanyEntitySubtype `json:"subtype,nullable"`
	// The tax payer type of the company.
	Type CompanyEntityType `json:"type,nullable"`
	JSON companyEntityJSON `json:"-"`
}

The entity type object.

func (*CompanyEntity) UnmarshalJSON

func (r *CompanyEntity) UnmarshalJSON(data []byte) (err error)

type CompanyEntitySubtype

type CompanyEntitySubtype string

The tax payer subtype of the company.

const (
	CompanyEntitySubtypeSCorporation CompanyEntitySubtype = "s_corporation"
	CompanyEntitySubtypeCCorporation CompanyEntitySubtype = "c_corporation"
	CompanyEntitySubtypeBCorporation CompanyEntitySubtype = "b_corporation"
)

func (CompanyEntitySubtype) IsKnown added in v0.16.0

func (r CompanyEntitySubtype) IsKnown() bool

type CompanyEntityType

type CompanyEntityType string

The tax payer type of the company.

const (
	CompanyEntityTypeLlc            CompanyEntityType = "llc"
	CompanyEntityTypeLp             CompanyEntityType = "lp"
	CompanyEntityTypeCorporation    CompanyEntityType = "corporation"
	CompanyEntityTypeSoleProprietor CompanyEntityType = "sole_proprietor"
	CompanyEntityTypeNonProfit      CompanyEntityType = "non_profit"
	CompanyEntityTypePartnership    CompanyEntityType = "partnership"
	CompanyEntityTypeCooperative    CompanyEntityType = "cooperative"
)

func (CompanyEntityType) IsKnown added in v0.16.0

func (r CompanyEntityType) IsKnown() bool

type CompanyEvent added in v0.10.0

type CompanyEvent struct {
	Data      map[string]interface{} `json:"data,nullable"`
	EventType CompanyEventEventType  `json:"event_type"`
	JSON      companyEventJSON       `json:"-"`
	BaseWebhookEvent
}

func (*CompanyEvent) UnmarshalJSON added in v0.10.0

func (r *CompanyEvent) UnmarshalJSON(data []byte) (err error)

type CompanyEventEventType added in v0.10.0

type CompanyEventEventType string
const (
	CompanyEventEventTypeCompanyUpdated CompanyEventEventType = "company.updated"
)

func (CompanyEventEventType) IsKnown added in v0.16.0

func (r CompanyEventEventType) IsKnown() bool

type ConnectionStatusType added in v0.9.0

type ConnectionStatusType = shared.ConnectionStatusType

This is an alias to an internal type.

type CreateAccessTokenResponse added in v0.8.0

type CreateAccessTokenResponse struct {
	AccessToken string `json:"access_token,required"`
	// The Finch uuid of the account used to connect this company.
	AccountID string `json:"account_id,required"`
	// The type of application associated with a token.
	ClientType CreateAccessTokenResponseClientType `json:"client_type,required"`
	// The Finch uuid of the company associated with the `access_token`.
	CompanyID string `json:"company_id,required"`
	// The type of the connection associated with the token.
	//
	// - `provider` - connection to an external provider
	// - `finch` - finch-generated data.
	ConnectionType CreateAccessTokenResponseConnectionType `json:"connection_type,required"`
	// An array of the authorized products associated with the `access_token`.
	Products []string `json:"products,required"`
	// The payroll provider associated with the `access_token`.
	ProviderID string                        `json:"provider_id,required"`
	JSON       createAccessTokenResponseJSON `json:"-"`
}

func (*CreateAccessTokenResponse) UnmarshalJSON added in v0.8.0

func (r *CreateAccessTokenResponse) UnmarshalJSON(data []byte) (err error)

type CreateAccessTokenResponseClientType added in v0.18.0

type CreateAccessTokenResponseClientType string

The type of application associated with a token.

const (
	CreateAccessTokenResponseClientTypeProduction  CreateAccessTokenResponseClientType = "production"
	CreateAccessTokenResponseClientTypeDevelopment CreateAccessTokenResponseClientType = "development"
	CreateAccessTokenResponseClientTypeSandbox     CreateAccessTokenResponseClientType = "sandbox"
)

func (CreateAccessTokenResponseClientType) IsKnown added in v0.18.0

type CreateAccessTokenResponseConnectionType added in v0.18.0

type CreateAccessTokenResponseConnectionType string

The type of the connection associated with the token.

- `provider` - connection to an external provider - `finch` - finch-generated data.

const (
	CreateAccessTokenResponseConnectionTypeProvider CreateAccessTokenResponseConnectionType = "provider"
	CreateAccessTokenResponseConnectionTypeFinch    CreateAccessTokenResponseConnectionType = "finch"
)

func (CreateAccessTokenResponseConnectionType) IsKnown added in v0.18.0

type CreateCompanyBenefitsResponse

type CreateCompanyBenefitsResponse struct {
	BenefitID string                            `json:"benefit_id,required"`
	JSON      createCompanyBenefitsResponseJSON `json:"-"`
}

func (*CreateCompanyBenefitsResponse) UnmarshalJSON

func (r *CreateCompanyBenefitsResponse) UnmarshalJSON(data []byte) (err error)

type DirectoryEvent added in v0.10.0

type DirectoryEvent struct {
	Data      DirectoryEventData      `json:"data"`
	EventType DirectoryEventEventType `json:"event_type"`
	JSON      directoryEventJSON      `json:"-"`
	BaseWebhookEvent
}

func (*DirectoryEvent) UnmarshalJSON added in v0.10.0

func (r *DirectoryEvent) UnmarshalJSON(data []byte) (err error)

type DirectoryEventData added in v0.10.0

type DirectoryEventData struct {
	// The ID of the individual related to the event.
	IndividualID string                 `json:"individual_id"`
	JSON         directoryEventDataJSON `json:"-"`
}

func (*DirectoryEventData) UnmarshalJSON added in v0.10.0

func (r *DirectoryEventData) UnmarshalJSON(data []byte) (err error)

type DirectoryEventEventType added in v0.10.0

type DirectoryEventEventType string
const (
	DirectoryEventEventTypeDirectoryCreated DirectoryEventEventType = "directory.created"
	DirectoryEventEventTypeDirectoryUpdated DirectoryEventEventType = "directory.updated"
	DirectoryEventEventTypeDirectoryDeleted DirectoryEventEventType = "directory.deleted"
)

func (DirectoryEventEventType) IsKnown added in v0.16.0

func (r DirectoryEventEventType) IsKnown() bool

type DisconnectResponse

type DisconnectResponse struct {
	// If the request is successful, Finch will return “success” (HTTP 200 status).
	Status string                 `json:"status,required"`
	JSON   disconnectResponseJSON `json:"-"`
}

func (*DisconnectResponse) UnmarshalJSON

func (r *DisconnectResponse) UnmarshalJSON(data []byte) (err error)

type EmploymentData

type EmploymentData struct {
	// string A stable Finch `id` (UUID v4) for an individual in the company.
	ID string `json:"id"`
	// Worker's compensation classification code for this employee
	ClassCode string `json:"class_code,nullable"`
	// Custom fields for the individual. These are fields which are defined by the
	// employer in the system.
	CustomFields []EmploymentDataCustomField `json:"custom_fields,nullable"`
	// The department object.
	Department EmploymentDataDepartment `json:"department,nullable"`
	// The employment object.
	Employment EmploymentDataEmployment `json:"employment,nullable"`
	EndDate    string                   `json:"end_date,nullable"`
	// The legal first name of the individual.
	FirstName string `json:"first_name,nullable"`
	// 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.
	Income Income `json:"income,nullable"`
	// The array of income history.
	IncomeHistory []Income `json:"income_history,nullable"`
	// `true` if the individual an an active employee or contractor at the company.
	IsActive bool `json:"is_active,nullable"`
	// The legal last name of the individual.
	LastName string   `json:"last_name,nullable"`
	Location Location `json:"location,nullable"`
	// The manager object representing the manager of the individual within the org.
	Manager EmploymentDataManager `json:"manager,nullable"`
	// The legal middle name of the individual.
	MiddleName string `json:"middle_name,nullable"`
	// The source system's unique employment identifier for this individual
	SourceID  string `json:"source_id,nullable"`
	StartDate string `json:"start_date,nullable"`
	// The current title of the individual.
	Title string `json:"title,nullable"`
	// This field is deprecated in favour of `source_id`
	WorkID string             `json:"work_id,nullable"`
	JSON   employmentDataJSON `json:"-"`
}

func (*EmploymentData) UnmarshalJSON

func (r *EmploymentData) UnmarshalJSON(data []byte) (err error)

type EmploymentDataCustomField added in v0.5.0

type EmploymentDataCustomField struct {
	Name  string                        `json:"name"`
	Value interface{}                   `json:"value"`
	JSON  employmentDataCustomFieldJSON `json:"-"`
}

func (*EmploymentDataCustomField) UnmarshalJSON added in v0.5.0

func (r *EmploymentDataCustomField) UnmarshalJSON(data []byte) (err error)

type EmploymentDataDepartment

type EmploymentDataDepartment struct {
	// The name of the department associated with the individual.
	Name string                       `json:"name,nullable"`
	JSON employmentDataDepartmentJSON `json:"-"`
}

The department object.

func (*EmploymentDataDepartment) UnmarshalJSON

func (r *EmploymentDataDepartment) UnmarshalJSON(data []byte) (err error)

type EmploymentDataEmployment

type EmploymentDataEmployment struct {
	// The secondary employment type of the individual. Options: `full_time`, `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.
	Subtype EmploymentDataEmploymentSubtype `json:"subtype,nullable"`
	// The main employment type of the individual.
	Type EmploymentDataEmploymentType `json:"type,nullable"`
	JSON employmentDataEmploymentJSON `json:"-"`
}

The employment object.

func (*EmploymentDataEmployment) UnmarshalJSON

func (r *EmploymentDataEmployment) UnmarshalJSON(data []byte) (err error)

type EmploymentDataEmploymentSubtype

type EmploymentDataEmploymentSubtype string

The secondary employment type of the individual. Options: `full_time`, `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.

const (
	EmploymentDataEmploymentSubtypeFullTime             EmploymentDataEmploymentSubtype = "full_time"
	EmploymentDataEmploymentSubtypeIntern               EmploymentDataEmploymentSubtype = "intern"
	EmploymentDataEmploymentSubtypePartTime             EmploymentDataEmploymentSubtype = "part_time"
	EmploymentDataEmploymentSubtypeTemp                 EmploymentDataEmploymentSubtype = "temp"
	EmploymentDataEmploymentSubtypeSeasonal             EmploymentDataEmploymentSubtype = "seasonal"
	EmploymentDataEmploymentSubtypeIndividualContractor EmploymentDataEmploymentSubtype = "individual_contractor"
)

func (EmploymentDataEmploymentSubtype) IsKnown added in v0.16.0

type EmploymentDataEmploymentType

type EmploymentDataEmploymentType string

The main employment type of the individual.

const (
	EmploymentDataEmploymentTypeEmployee   EmploymentDataEmploymentType = "employee"
	EmploymentDataEmploymentTypeContractor EmploymentDataEmploymentType = "contractor"
)

func (EmploymentDataEmploymentType) IsKnown added in v0.16.0

func (r EmploymentDataEmploymentType) IsKnown() bool

type EmploymentDataManager

type EmploymentDataManager struct {
	// A stable Finch `id` (UUID v4) for an individual in the company.
	ID   string                    `json:"id"`
	JSON employmentDataManagerJSON `json:"-"`
}

The manager object representing the manager of the individual within the org.

func (*EmploymentDataManager) UnmarshalJSON

func (r *EmploymentDataManager) UnmarshalJSON(data []byte) (err error)

type EmploymentDataResponse

type EmploymentDataResponse struct {
	Body         EmploymentData             `json:"body"`
	Code         int64                      `json:"code"`
	IndividualID string                     `json:"individual_id"`
	JSON         employmentDataResponseJSON `json:"-"`
}

func (*EmploymentDataResponse) UnmarshalJSON

func (r *EmploymentDataResponse) UnmarshalJSON(data []byte) (err error)

type EmploymentEvent added in v0.10.0

type EmploymentEvent struct {
	Data      EmploymentEventData      `json:"data"`
	EventType EmploymentEventEventType `json:"event_type"`
	JSON      employmentEventJSON      `json:"-"`
	BaseWebhookEvent
}

func (*EmploymentEvent) UnmarshalJSON added in v0.10.0

func (r *EmploymentEvent) UnmarshalJSON(data []byte) (err error)

type EmploymentEventData added in v0.10.0

type EmploymentEventData struct {
	// The ID of the individual related to the event.
	IndividualID string                  `json:"individual_id"`
	JSON         employmentEventDataJSON `json:"-"`
}

func (*EmploymentEventData) UnmarshalJSON added in v0.10.0

func (r *EmploymentEventData) UnmarshalJSON(data []byte) (err error)

type EmploymentEventEventType added in v0.10.0

type EmploymentEventEventType string
const (
	EmploymentEventEventTypeEmploymentCreated EmploymentEventEventType = "employment.created"
	EmploymentEventEventTypeEmploymentUpdated EmploymentEventEventType = "employment.updated"
	EmploymentEventEventTypeEmploymentDeleted EmploymentEventEventType = "employment.deleted"
)

func (EmploymentEventEventType) IsKnown added in v0.16.0

func (r EmploymentEventEventType) IsKnown() bool

type Error

type Error = apierror.Error

type GetAccessTokenParams added in v0.7.0

type GetAccessTokenParams struct {
}

type GetAuthURLParams added in v0.7.0

type GetAuthURLParams struct {
}

type HRISBenefitIndividualEnrolledIDsResponse

type HRISBenefitIndividualEnrolledIDsResponse struct {
	BenefitID     string                                       `json:"benefit_id,required"`
	IndividualIDs []string                                     `json:"individual_ids,required"`
	JSON          hrisBenefitIndividualEnrolledIDsResponseJSON `json:"-"`
}

func (*HRISBenefitIndividualEnrolledIDsResponse) UnmarshalJSON

func (r *HRISBenefitIndividualEnrolledIDsResponse) UnmarshalJSON(data []byte) (err error)

type HRISBenefitIndividualGetManyBenefitsParams

type HRISBenefitIndividualGetManyBenefitsParams struct {
	// comma-delimited list of stable Finch uuids for each individual. If empty,
	// defaults to all individuals
	IndividualIDs param.Field[string] `query:"individual_ids"`
}

func (HRISBenefitIndividualGetManyBenefitsParams) URLQuery

URLQuery serializes HRISBenefitIndividualGetManyBenefitsParams's query parameters as `url.Values`.

type HRISBenefitIndividualService

type HRISBenefitIndividualService struct {
	Options []option.RequestOption
}

HRISBenefitIndividualService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHRISBenefitIndividualService method instead.

func NewHRISBenefitIndividualService

func NewHRISBenefitIndividualService(opts ...option.RequestOption) (r *HRISBenefitIndividualService)

NewHRISBenefitIndividualService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*HRISBenefitIndividualService) EnrolledIDs

Lists individuals currently enrolled in a given deduction.

func (*HRISBenefitIndividualService) GetManyBenefits

Get enrollment information for the given individuals.

func (*HRISBenefitIndividualService) GetManyBenefitsAutoPaging

Get enrollment information for the given individuals.

func (*HRISBenefitIndividualService) UnenrollMany

Unenroll individuals from a deduction or contribution

func (*HRISBenefitIndividualService) UnenrollManyAutoPaging

Unenroll individuals from a deduction or contribution

type HRISBenefitIndividualUnenrollManyParams

type HRISBenefitIndividualUnenrollManyParams struct {
	// Array of individual_ids to unenroll.
	IndividualIDs param.Field[[]string] `json:"individual_ids"`
}

func (HRISBenefitIndividualUnenrollManyParams) MarshalJSON

func (r HRISBenefitIndividualUnenrollManyParams) MarshalJSON() (data []byte, err error)

type HRISBenefitNewParams

type HRISBenefitNewParams struct {
	Description param.Field[string]           `json:"description"`
	Frequency   param.Field[BenefitFrequency] `json:"frequency"`
	// Type of benefit.
	Type param.Field[BenefitType] `json:"type"`
}

func (HRISBenefitNewParams) MarshalJSON

func (r HRISBenefitNewParams) MarshalJSON() (data []byte, err error)

type HRISBenefitService

type HRISBenefitService struct {
	Options     []option.RequestOption
	Individuals *HRISBenefitIndividualService
}

HRISBenefitService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHRISBenefitService method instead.

func NewHRISBenefitService

func NewHRISBenefitService(opts ...option.RequestOption) (r *HRISBenefitService)

NewHRISBenefitService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*HRISBenefitService) Get

func (r *HRISBenefitService) Get(ctx context.Context, benefitID string, opts ...option.RequestOption) (res *CompanyBenefit, err error)

Lists deductions and contributions information for a given item

func (*HRISBenefitService) List

List all company-wide deductions and contributions.

func (*HRISBenefitService) ListAutoPaging

List all company-wide deductions and contributions.

func (*HRISBenefitService) ListSupportedBenefits

func (r *HRISBenefitService) ListSupportedBenefits(ctx context.Context, opts ...option.RequestOption) (res *pagination.SinglePage[SupportedBenefit], err error)

Get deductions metadata

func (*HRISBenefitService) ListSupportedBenefitsAutoPaging

func (r *HRISBenefitService) ListSupportedBenefitsAutoPaging(ctx context.Context, opts ...option.RequestOption) *pagination.SinglePageAutoPager[SupportedBenefit]

Get deductions metadata

func (*HRISBenefitService) New

Creates a new company-wide deduction or contribution. Please use the `/providers` endpoint to view available types for each provider.

func (*HRISBenefitService) Update

Updates an existing company-wide deduction or contribution

type HRISBenefitUpdateParams

type HRISBenefitUpdateParams struct {
	// Updated name or description.
	Description param.Field[string] `json:"description"`
}

func (HRISBenefitUpdateParams) MarshalJSON

func (r HRISBenefitUpdateParams) MarshalJSON() (data []byte, err error)

type HRISCompanyService

type HRISCompanyService struct {
	Options []option.RequestOption
}

HRISCompanyService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHRISCompanyService method instead.

func NewHRISCompanyService

func NewHRISCompanyService(opts ...option.RequestOption) (r *HRISCompanyService)

NewHRISCompanyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*HRISCompanyService) Get

func (r *HRISCompanyService) Get(ctx context.Context, opts ...option.RequestOption) (res *Company, err error)

Read basic company data

type HRISDirectoryListIndividualsParams

type HRISDirectoryListIndividualsParams struct {
	// Number of employees to return (defaults to all)
	Limit param.Field[int64] `query:"limit"`
	// Index to start from (defaults to 0)
	Offset param.Field[int64] `query:"offset"`
}

func (HRISDirectoryListIndividualsParams) URLQuery

URLQuery serializes HRISDirectoryListIndividualsParams's query parameters as `url.Values`.

type HRISDirectoryListParams added in v0.0.7

type HRISDirectoryListParams struct {
	// Number of employees to return (defaults to all)
	Limit param.Field[int64] `query:"limit"`
	// Index to start from (defaults to 0)
	Offset param.Field[int64] `query:"offset"`
}

func (HRISDirectoryListParams) URLQuery added in v0.0.7

func (r HRISDirectoryListParams) URLQuery() (v url.Values)

URLQuery serializes HRISDirectoryListParams's query parameters as `url.Values`.

type HRISDirectoryService

type HRISDirectoryService struct {
	Options []option.RequestOption
}

HRISDirectoryService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHRISDirectoryService method instead.

func NewHRISDirectoryService

func NewHRISDirectoryService(opts ...option.RequestOption) (r *HRISDirectoryService)

NewHRISDirectoryService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*HRISDirectoryService) List added in v0.0.7

Read company directory and organization structure

func (*HRISDirectoryService) ListAutoPaging added in v0.0.7

Read company directory and organization structure

func (*HRISDirectoryService) ListIndividuals deprecated

Read company directory and organization structure

Deprecated: use `List` instead

func (*HRISDirectoryService) ListIndividualsAutoPaging deprecated

Read company directory and organization structure

Deprecated: use `List` instead

type HRISEmploymentGetManyParams

type HRISEmploymentGetManyParams struct {
	// The array of batch requests.
	Requests param.Field[[]HRISEmploymentGetManyParamsRequest] `json:"requests,required"`
}

func (HRISEmploymentGetManyParams) MarshalJSON

func (r HRISEmploymentGetManyParams) MarshalJSON() (data []byte, err error)

type HRISEmploymentGetManyParamsRequest

type HRISEmploymentGetManyParamsRequest struct {
	// A stable Finch `id` (UUID v4) for an individual in the company. There is no
	// limit to the number of `individual_id` to send per request. It is preferantial
	// to send all ids in a single request for Finch to optimize provider rate-limits.
	IndividualID param.Field[string] `json:"individual_id,required"`
}

func (HRISEmploymentGetManyParamsRequest) MarshalJSON

func (r HRISEmploymentGetManyParamsRequest) MarshalJSON() (data []byte, err error)

type HRISEmploymentService

type HRISEmploymentService struct {
	Options []option.RequestOption
}

HRISEmploymentService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHRISEmploymentService method instead.

func NewHRISEmploymentService

func NewHRISEmploymentService(opts ...option.RequestOption) (r *HRISEmploymentService)

NewHRISEmploymentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*HRISEmploymentService) GetMany

Read individual employment and income data

func (*HRISEmploymentService) GetManyAutoPaging

Read individual employment and income data

type HRISIndividualGetManyParams

type HRISIndividualGetManyParams struct {
	Options  param.Field[HRISIndividualGetManyParamsOptions]   `json:"options"`
	Requests param.Field[[]HRISIndividualGetManyParamsRequest] `json:"requests"`
}

func (HRISIndividualGetManyParams) MarshalJSON

func (r HRISIndividualGetManyParams) MarshalJSON() (data []byte, err error)

type HRISIndividualGetManyParamsOptions

type HRISIndividualGetManyParamsOptions struct {
	Include param.Field[[]string] `json:"include"`
}

func (HRISIndividualGetManyParamsOptions) MarshalJSON

func (r HRISIndividualGetManyParamsOptions) MarshalJSON() (data []byte, err error)

type HRISIndividualGetManyParamsRequest

type HRISIndividualGetManyParamsRequest struct {
	IndividualID param.Field[string] `json:"individual_id"`
}

func (HRISIndividualGetManyParamsRequest) MarshalJSON

func (r HRISIndividualGetManyParamsRequest) MarshalJSON() (data []byte, err error)

type HRISIndividualService

type HRISIndividualService struct {
	Options []option.RequestOption
}

HRISIndividualService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHRISIndividualService method instead.

func NewHRISIndividualService

func NewHRISIndividualService(opts ...option.RequestOption) (r *HRISIndividualService)

NewHRISIndividualService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*HRISIndividualService) GetMany

Read individual data, excluding income and employment data

func (*HRISIndividualService) GetManyAutoPaging

Read individual data, excluding income and employment data

type HRISPayStatementGetManyParams

type HRISPayStatementGetManyParams struct {
	// The array of batch requests.
	Requests param.Field[[]HRISPayStatementGetManyParamsRequest] `json:"requests,required"`
}

func (HRISPayStatementGetManyParams) MarshalJSON

func (r HRISPayStatementGetManyParams) MarshalJSON() (data []byte, err error)

type HRISPayStatementGetManyParamsRequest

type HRISPayStatementGetManyParamsRequest struct {
	// A stable Finch `id` (UUID v4) for a payment.
	PaymentID param.Field[string] `json:"payment_id,required"`
	// Number of pay statements to return (defaults to all).
	Limit param.Field[int64] `json:"limit"`
	// Index to start from.
	Offset param.Field[int64] `json:"offset"`
}

func (HRISPayStatementGetManyParamsRequest) MarshalJSON

func (r HRISPayStatementGetManyParamsRequest) MarshalJSON() (data []byte, err error)

type HRISPayStatementService

type HRISPayStatementService struct {
	Options []option.RequestOption
}

HRISPayStatementService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHRISPayStatementService method instead.

func NewHRISPayStatementService

func NewHRISPayStatementService(opts ...option.RequestOption) (r *HRISPayStatementService)

NewHRISPayStatementService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*HRISPayStatementService) GetMany

Read detailed pay statements for each individual.

Deduction and contribution types are supported by the payroll systems that supports Benefits.

func (*HRISPayStatementService) GetManyAutoPaging

Read detailed pay statements for each individual.

Deduction and contribution types are supported by the payroll systems that supports Benefits.

type HRISPaymentListParams

type HRISPaymentListParams struct {
	// The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD`
	// format.
	EndDate param.Field[time.Time] `query:"end_date,required" format:"date"`
	// The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD`
	// format.
	StartDate param.Field[time.Time] `query:"start_date,required" format:"date"`
}

func (HRISPaymentListParams) URLQuery

func (r HRISPaymentListParams) URLQuery() (v url.Values)

URLQuery serializes HRISPaymentListParams's query parameters as `url.Values`.

type HRISPaymentService

type HRISPaymentService struct {
	Options []option.RequestOption
}

HRISPaymentService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHRISPaymentService method instead.

func NewHRISPaymentService

func NewHRISPaymentService(opts ...option.RequestOption) (r *HRISPaymentService)

NewHRISPaymentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*HRISPaymentService) List

Read payroll and contractor related payments by the company.

func (*HRISPaymentService) ListAutoPaging

Read payroll and contractor related payments by the company.

type HRISService

type HRISService struct {
	Options       []option.RequestOption
	Company       *HRISCompanyService
	Directory     *HRISDirectoryService
	Individuals   *HRISIndividualService
	Employments   *HRISEmploymentService
	Payments      *HRISPaymentService
	PayStatements *HRISPayStatementService
	Benefits      *HRISBenefitService
}

HRISService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHRISService method instead.

func NewHRISService

func NewHRISService(opts ...option.RequestOption) (r *HRISService)

NewHRISService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type Income

type Income struct {
	// The income amount in cents.
	Amount int64 `json:"amount,nullable"`
	// The currency code.
	Currency string `json:"currency,nullable"`
	// The date the income amount went into effect.
	EffectiveDate string `json:"effective_date,nullable"`
	// The income unit of payment. Options: `yearly`, `quarterly`, `monthly`,
	// `semi_monthly`, `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`.
	Unit IncomeUnit `json:"unit,nullable"`
	JSON incomeJSON `json:"-"`
}

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.

func (*Income) UnmarshalJSON

func (r *Income) UnmarshalJSON(data []byte) (err error)

type IncomeParam added in v0.8.0

type IncomeParam struct {
	// The income amount in cents.
	Amount param.Field[int64] `json:"amount"`
	// The currency code.
	Currency param.Field[string] `json:"currency"`
	// The date the income amount went into effect.
	EffectiveDate param.Field[string] `json:"effective_date"`
	// The income unit of payment. Options: `yearly`, `quarterly`, `monthly`,
	// `semi_monthly`, `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`.
	Unit param.Field[IncomeUnit] `json:"unit"`
}

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.

func (IncomeParam) MarshalJSON added in v0.8.0

func (r IncomeParam) MarshalJSON() (data []byte, err error)

type IncomeUnit

type IncomeUnit string

The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`.

const (
	IncomeUnitYearly      IncomeUnit = "yearly"
	IncomeUnitQuarterly   IncomeUnit = "quarterly"
	IncomeUnitMonthly     IncomeUnit = "monthly"
	IncomeUnitSemiMonthly IncomeUnit = "semi_monthly"
	IncomeUnitBiWeekly    IncomeUnit = "bi_weekly"
	IncomeUnitWeekly      IncomeUnit = "weekly"
	IncomeUnitDaily       IncomeUnit = "daily"
	IncomeUnitHourly      IncomeUnit = "hourly"
	IncomeUnitFixed       IncomeUnit = "fixed"
)

func (IncomeUnit) IsKnown added in v0.16.0

func (r IncomeUnit) IsKnown() bool

type Individual

type Individual struct {
	// A stable Finch `id` (UUID v4) for an individual in the company.
	ID     string            `json:"id"`
	Dob    string            `json:"dob,nullable"`
	Emails []IndividualEmail `json:"emails,nullable"`
	// 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.
	EncryptedSsn string `json:"encrypted_ssn,nullable"`
	// The EEOC-defined ethnicity of the individual.
	Ethnicity IndividualEthnicity `json:"ethnicity,nullable"`
	// The legal first name of the individual.
	FirstName string `json:"first_name,nullable"`
	// The gender of the individual.
	Gender IndividualGender `json:"gender,nullable"`
	// The legal last name of the individual.
	LastName string `json:"last_name,nullable"`
	// The legal middle name of the individual.
	MiddleName   string                  `json:"middle_name,nullable"`
	PhoneNumbers []IndividualPhoneNumber `json:"phone_numbers,nullable"`
	// The preferred name of the individual.
	PreferredName string   `json:"preferred_name,nullable"`
	Residence     Location `json:"residence,nullable"`
	// 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.
	Ssn  string         `json:"ssn,nullable"`
	JSON individualJSON `json:"-"`
}

func (*Individual) UnmarshalJSON

func (r *Individual) UnmarshalJSON(data []byte) (err error)

type IndividualBenefit

type IndividualBenefit struct {
	Body         IndividualBenefitBody `json:"body"`
	Code         int64                 `json:"code"`
	IndividualID string                `json:"individual_id"`
	JSON         individualBenefitJSON `json:"-"`
}

func (*IndividualBenefit) UnmarshalJSON

func (r *IndividualBenefit) UnmarshalJSON(data []byte) (err error)

type IndividualBenefitBody

type IndividualBenefitBody struct {
	// If the benefit supports annual maximum, the amount in cents for this individual.
	AnnualMaximum int64 `json:"annual_maximum,nullable"`
	// If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled
	// for this individual.
	CatchUp             bool                `json:"catch_up,nullable"`
	CompanyContribution BenefitContribution `json:"company_contribution,nullable"`
	EmployeeDeduction   BenefitContribution `json:"employee_deduction,nullable"`
	// Type for HSA contribution limit if the benefit is a HSA.
	HsaContributionLimit IndividualBenefitBodyHsaContributionLimit `json:"hsa_contribution_limit,nullable"`
	JSON                 individualBenefitBodyJSON                 `json:"-"`
}

func (*IndividualBenefitBody) UnmarshalJSON

func (r *IndividualBenefitBody) UnmarshalJSON(data []byte) (err error)

type IndividualBenefitBodyHsaContributionLimit

type IndividualBenefitBodyHsaContributionLimit string

Type for HSA contribution limit if the benefit is a HSA.

const (
	IndividualBenefitBodyHsaContributionLimitIndividual IndividualBenefitBodyHsaContributionLimit = "individual"
	IndividualBenefitBodyHsaContributionLimitFamily     IndividualBenefitBodyHsaContributionLimit = "family"
)

func (IndividualBenefitBodyHsaContributionLimit) IsKnown added in v0.16.0

type IndividualEmail

type IndividualEmail struct {
	Data string               `json:"data"`
	Type IndividualEmailsType `json:"type,nullable"`
	JSON individualEmailJSON  `json:"-"`
}

func (*IndividualEmail) UnmarshalJSON

func (r *IndividualEmail) UnmarshalJSON(data []byte) (err error)

type IndividualEmailsType

type IndividualEmailsType string
const (
	IndividualEmailsTypeWork     IndividualEmailsType = "work"
	IndividualEmailsTypePersonal IndividualEmailsType = "personal"
)

func (IndividualEmailsType) IsKnown added in v0.16.0

func (r IndividualEmailsType) IsKnown() bool

type IndividualEthnicity added in v0.5.0

type IndividualEthnicity string

The EEOC-defined ethnicity of the individual.

const (
	IndividualEthnicityAsian                           IndividualEthnicity = "asian"
	IndividualEthnicityWhite                           IndividualEthnicity = "white"
	IndividualEthnicityBlackOrAfricanAmerican          IndividualEthnicity = "black_or_african_american"
	IndividualEthnicityNativeHawaiianOrPacificIslander IndividualEthnicity = "native_hawaiian_or_pacific_islander"
	IndividualEthnicityAmericanIndianOrAlaskaNative    IndividualEthnicity = "american_indian_or_alaska_native"
	IndividualEthnicityHispanicOrLatino                IndividualEthnicity = "hispanic_or_latino"
	IndividualEthnicityTwoOrMoreRaces                  IndividualEthnicity = "two_or_more_races"
	IndividualEthnicityDeclineToSpecify                IndividualEthnicity = "decline_to_specify"
)

func (IndividualEthnicity) IsKnown added in v0.16.0

func (r IndividualEthnicity) IsKnown() bool

type IndividualEvent added in v0.10.0

type IndividualEvent struct {
	Data      IndividualEventData      `json:"data"`
	EventType IndividualEventEventType `json:"event_type"`
	JSON      individualEventJSON      `json:"-"`
	BaseWebhookEvent
}

func (*IndividualEvent) UnmarshalJSON added in v0.10.0

func (r *IndividualEvent) UnmarshalJSON(data []byte) (err error)

type IndividualEventData added in v0.10.0

type IndividualEventData struct {
	// The ID of the individual related to the event.
	IndividualID string                  `json:"individual_id"`
	JSON         individualEventDataJSON `json:"-"`
}

func (*IndividualEventData) UnmarshalJSON added in v0.10.0

func (r *IndividualEventData) UnmarshalJSON(data []byte) (err error)

type IndividualEventEventType added in v0.10.0

type IndividualEventEventType string
const (
	IndividualEventEventTypeIndividualCreated IndividualEventEventType = "individual.created"
	IndividualEventEventTypeIndividualUpdated IndividualEventEventType = "individual.updated"
	IndividualEventEventTypeIndividualDeleted IndividualEventEventType = "individual.deleted"
)

func (IndividualEventEventType) IsKnown added in v0.16.0

func (r IndividualEventEventType) IsKnown() bool

type IndividualGender

type IndividualGender string

The gender of the individual.

const (
	IndividualGenderFemale           IndividualGender = "female"
	IndividualGenderMale             IndividualGender = "male"
	IndividualGenderOther            IndividualGender = "other"
	IndividualGenderDeclineToSpecify IndividualGender = "decline_to_specify"
)

func (IndividualGender) IsKnown added in v0.16.0

func (r IndividualGender) IsKnown() bool

type IndividualInDirectory

type IndividualInDirectory struct {
	// A stable Finch id (UUID v4) for an individual in the company.
	ID string `json:"id"`
	// The department object.
	Department IndividualInDirectoryDepartment `json:"department,nullable"`
	// The legal first name of the individual.
	FirstName string `json:"first_name,nullable"`
	// `true` if the individual is an active employee or contractor at the company.
	IsActive bool `json:"is_active,nullable"`
	// The legal last name of the individual.
	LastName string `json:"last_name,nullable"`
	// The manager object.
	Manager IndividualInDirectoryManager `json:"manager,nullable"`
	// The legal middle name of the individual.
	MiddleName string                    `json:"middle_name,nullable"`
	JSON       individualInDirectoryJSON `json:"-"`
}

func (*IndividualInDirectory) UnmarshalJSON

func (r *IndividualInDirectory) UnmarshalJSON(data []byte) (err error)

type IndividualInDirectoryDepartment

type IndividualInDirectoryDepartment struct {
	// The name of the department.
	Name string                              `json:"name,nullable"`
	JSON individualInDirectoryDepartmentJSON `json:"-"`
}

The department object.

func (*IndividualInDirectoryDepartment) UnmarshalJSON

func (r *IndividualInDirectoryDepartment) UnmarshalJSON(data []byte) (err error)

type IndividualInDirectoryManager

type IndividualInDirectoryManager struct {
	// A stable Finch `id` (UUID v4) for an individual in the company.
	ID   string                           `json:"id"`
	JSON individualInDirectoryManagerJSON `json:"-"`
}

The manager object.

func (*IndividualInDirectoryManager) UnmarshalJSON

func (r *IndividualInDirectoryManager) UnmarshalJSON(data []byte) (err error)

type IndividualPhoneNumber

type IndividualPhoneNumber struct {
	Data string                     `json:"data,nullable"`
	Type IndividualPhoneNumbersType `json:"type,nullable"`
	JSON individualPhoneNumberJSON  `json:"-"`
}

func (*IndividualPhoneNumber) UnmarshalJSON

func (r *IndividualPhoneNumber) UnmarshalJSON(data []byte) (err error)

type IndividualPhoneNumbersType

type IndividualPhoneNumbersType string
const (
	IndividualPhoneNumbersTypeWork     IndividualPhoneNumbersType = "work"
	IndividualPhoneNumbersTypePersonal IndividualPhoneNumbersType = "personal"
)

func (IndividualPhoneNumbersType) IsKnown added in v0.16.0

func (r IndividualPhoneNumbersType) IsKnown() bool

type IndividualResponse

type IndividualResponse struct {
	Body         Individual             `json:"body"`
	Code         int64                  `json:"code"`
	IndividualID string                 `json:"individual_id"`
	JSON         individualResponseJSON `json:"-"`
}

func (*IndividualResponse) UnmarshalJSON

func (r *IndividualResponse) UnmarshalJSON(data []byte) (err error)

type IndividualsPage

type IndividualsPage struct {
	// The array of employees.
	Individuals []IndividualInDirectory `json:"individuals"`
	Paging      shared.Paging           `json:"paging,required"`
	JSON        individualsPageJSON     `json:"-"`
	// contains filtered or unexported fields
}

func (*IndividualsPage) GetNextPage

func (r *IndividualsPage) GetNextPage() (res *IndividualsPage, err error)

NextPage returns the next page as defined by this pagination style. When there is no next page, this function will return a 'nil' for the page value, but will not return an error

func (*IndividualsPage) SetPageConfig

func (r *IndividualsPage) SetPageConfig(cfg *requestconfig.RequestConfig, res *http.Response)

func (*IndividualsPage) UnmarshalJSON

func (r *IndividualsPage) UnmarshalJSON(data []byte) (err error)

type IndividualsPageAutoPager

type IndividualsPageAutoPager struct {
	// contains filtered or unexported fields
}

func NewIndividualsPageAutoPager

func NewIndividualsPageAutoPager(page *IndividualsPage, err error) *IndividualsPageAutoPager

func (*IndividualsPageAutoPager) Current

func (*IndividualsPageAutoPager) Err

func (*IndividualsPageAutoPager) Index

func (r *IndividualsPageAutoPager) Index() int

func (*IndividualsPageAutoPager) Next

func (r *IndividualsPageAutoPager) Next() bool

type Introspection

type Introspection struct {
	// The Finch uuid of the account used to connect this company.
	AccountID             string                             `json:"account_id,required"`
	AuthenticationMethods IntrospectionAuthenticationMethods `json:"authentication_methods,required"`
	// The client id of the application associated with the `access_token`.
	ClientID string `json:"client_id,required"`
	// The type of application associated with a token.
	ClientType IntrospectionClientType `json:"client_type,required"`
	// The Finch uuid of the company associated with the `access_token`.
	CompanyID string `json:"company_id,required"`
	// The type of the connection associated with the token.
	//
	// - `provider` - connection to an external provider
	// - `finch` - finch-generated data.
	ConnectionType IntrospectionConnectionType `json:"connection_type,required"`
	// Whether the connection associated with the `access_token` uses the Assisted
	// Connect Flow. (`true` if using Assisted Connect, `false` if connection is
	// automated)
	Manual bool `json:"manual,required"`
	// The payroll provider associated with the `access_token`.
	PayrollProviderID string `json:"payroll_provider_id,required"`
	// An array of the authorized products associated with the `access_token`.
	Products []string `json:"products,required"`
	// The account username used for login associated with the `access_token`.
	Username string            `json:"username,required"`
	JSON     introspectionJSON `json:"-"`
}

func (*Introspection) UnmarshalJSON

func (r *Introspection) UnmarshalJSON(data []byte) (err error)

type IntrospectionAuthenticationMethods added in v0.8.0

type IntrospectionAuthenticationMethods struct {
	ConnectionStatus IntrospectionAuthenticationMethodsConnectionStatus `json:"connection_status"`
	Type             string                                             `json:"type"`
	JSON             introspectionAuthenticationMethodsJSON             `json:"-"`
}

func (*IntrospectionAuthenticationMethods) UnmarshalJSON added in v0.8.0

func (r *IntrospectionAuthenticationMethods) UnmarshalJSON(data []byte) (err error)

type IntrospectionAuthenticationMethodsConnectionStatus added in v0.8.0

type IntrospectionAuthenticationMethodsConnectionStatus struct {
	Message string                                                 `json:"message"`
	Status  shared.ConnectionStatusType                            `json:"status"`
	JSON    introspectionAuthenticationMethodsConnectionStatusJSON `json:"-"`
}

func (*IntrospectionAuthenticationMethodsConnectionStatus) UnmarshalJSON added in v0.8.0

func (r *IntrospectionAuthenticationMethodsConnectionStatus) UnmarshalJSON(data []byte) (err error)

type IntrospectionClientType added in v0.7.0

type IntrospectionClientType string

The type of application associated with a token.

const (
	IntrospectionClientTypeProduction  IntrospectionClientType = "production"
	IntrospectionClientTypeDevelopment IntrospectionClientType = "development"
	IntrospectionClientTypeSandbox     IntrospectionClientType = "sandbox"
)

func (IntrospectionClientType) IsKnown added in v0.16.0

func (r IntrospectionClientType) IsKnown() bool

type IntrospectionConnectionType added in v0.7.0

type IntrospectionConnectionType string

The type of the connection associated with the token.

- `provider` - connection to an external provider - `finch` - finch-generated data.

const (
	IntrospectionConnectionTypeProvider IntrospectionConnectionType = "provider"
	IntrospectionConnectionTypeFinch    IntrospectionConnectionType = "finch"
)

func (IntrospectionConnectionType) IsKnown added in v0.16.0

func (r IntrospectionConnectionType) IsKnown() bool

type JobAutomatedListParams added in v0.7.0

type JobAutomatedListParams struct {
	// Number of items to return
	Limit param.Field[int64] `query:"limit"`
	// Index to start from (defaults to 0)
	Offset param.Field[int64] `query:"offset"`
}

func (JobAutomatedListParams) URLQuery added in v0.7.0

func (r JobAutomatedListParams) URLQuery() (v url.Values)

URLQuery serializes JobAutomatedListParams's query parameters as `url.Values`.

type JobAutomatedNewParams added in v0.7.0

type JobAutomatedNewParams struct {
	// The type of job to start. Currently the only supported type is `data_sync_all`
	Type param.Field[JobAutomatedNewParamsType] `json:"type,required"`
}

func (JobAutomatedNewParams) MarshalJSON added in v0.7.0

func (r JobAutomatedNewParams) MarshalJSON() (data []byte, err error)

type JobAutomatedNewParamsType added in v0.7.0

type JobAutomatedNewParamsType string

The type of job to start. Currently the only supported type is `data_sync_all`

const (
	JobAutomatedNewParamsTypeDataSyncAll JobAutomatedNewParamsType = "data_sync_all"
)

func (JobAutomatedNewParamsType) IsKnown added in v0.16.0

func (r JobAutomatedNewParamsType) IsKnown() bool

type JobAutomatedNewResponse added in v0.7.0

type JobAutomatedNewResponse struct {
	// The number of allowed refreshes per hour (per hour, fixed window)
	AllowedRefreshes int64 `json:"allowed_refreshes,required"`
	// The id of the job that has been created.
	JobID string `json:"job_id,required" format:"uuid"`
	// The url that can be used to retrieve the job status
	JobURL string `json:"job_url,required"`
	// The number of remaining refreshes available (per hour, fixed window)
	RemainingRefreshes int64                       `json:"remaining_refreshes,required"`
	JSON               jobAutomatedNewResponseJSON `json:"-"`
}

func (*JobAutomatedNewResponse) UnmarshalJSON added in v0.7.0

func (r *JobAutomatedNewResponse) UnmarshalJSON(data []byte) (err error)

type JobAutomatedService added in v0.7.0

type JobAutomatedService struct {
	Options []option.RequestOption
}

JobAutomatedService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewJobAutomatedService method instead.

func NewJobAutomatedService added in v0.7.0

func NewJobAutomatedService(opts ...option.RequestOption) (r *JobAutomatedService)

NewJobAutomatedService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*JobAutomatedService) Get added in v0.7.0

func (r *JobAutomatedService) Get(ctx context.Context, jobID string, opts ...option.RequestOption) (res *AutomatedAsyncJob, err error)

Get an automated job by `job_id`.

func (*JobAutomatedService) List added in v0.7.0

Get 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.

func (*JobAutomatedService) ListAutoPaging added in v0.7.0

Get 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.

func (*JobAutomatedService) New added in v0.7.0

Enqueue an automated job. Currently, only the `data_sync_all` job type is supported, which will enqueue a job to re-sync all data for a connection. `data_sync_all` has a concurrency limit of 1 job at a time per connection. This means that if this endpoint is called while a job is already in progress for this connection, Finch will return the `job_id` of the job that is currently in progress. Finch allows a fixed window rate limit of 1 forced refresh per hour per connection.

This endpoint is available for _Scale_ tier customers as an add-on. To request access to this endpoint, please contact your Finch account manager.

type JobCompletionEvent added in v0.10.0

type JobCompletionEvent struct {
	Data      JobCompletionEventData      `json:"data"`
	EventType JobCompletionEventEventType `json:"event_type"`
	JSON      jobCompletionEventJSON      `json:"-"`
	BaseWebhookEvent
}

func (*JobCompletionEvent) UnmarshalJSON added in v0.10.0

func (r *JobCompletionEvent) UnmarshalJSON(data []byte) (err error)

type JobCompletionEventData added in v0.10.0

type JobCompletionEventData struct {
	// The id of the job which has completed.
	JobID string `json:"job_id,required"`
	// The url to query the result of the job.
	JobURL string                     `json:"job_url,required"`
	JSON   jobCompletionEventDataJSON `json:"-"`
}

func (*JobCompletionEventData) UnmarshalJSON added in v0.10.0

func (r *JobCompletionEventData) UnmarshalJSON(data []byte) (err error)

type JobCompletionEventEventType added in v0.10.0

type JobCompletionEventEventType string
const (
	JobCompletionEventEventTypeJobBenefitCreateUpdated   JobCompletionEventEventType = "job.benefit_create.updated"
	JobCompletionEventEventTypeJobBenefitEnrollUpdated   JobCompletionEventEventType = "job.benefit_enroll.updated"
	JobCompletionEventEventTypeJobBenefitRegisterUpdated JobCompletionEventEventType = "job.benefit_register.updated"
	JobCompletionEventEventTypeJobBenefitUnenrollUpdated JobCompletionEventEventType = "job.benefit_unenroll.updated"
	JobCompletionEventEventTypeJobBenefitUpdateUpdated   JobCompletionEventEventType = "job.benefit_update.updated"
	JobCompletionEventEventTypeJobDataSyncAllUpdated     JobCompletionEventEventType = "job.data_sync_all.updated"
)

func (JobCompletionEventEventType) IsKnown added in v0.16.0

func (r JobCompletionEventEventType) IsKnown() bool

type JobManualService added in v0.7.0

type JobManualService struct {
	Options []option.RequestOption
}

JobManualService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewJobManualService method instead.

func NewJobManualService added in v0.7.0

func NewJobManualService(opts ...option.RequestOption) (r *JobManualService)

NewJobManualService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*JobManualService) Get added in v0.7.0

func (r *JobManualService) Get(ctx context.Context, jobID string, opts ...option.RequestOption) (res *ManualAsyncJob, err error)

Get a manual job by `job_id`. Manual jobs are completed by a human and include Assisted Benefits jobs.

type JobService added in v0.7.0

type JobService struct {
	Options   []option.RequestOption
	Automated *JobAutomatedService
	Manual    *JobManualService
}

JobService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewJobService method instead.

func NewJobService added in v0.7.0

func NewJobService(opts ...option.RequestOption) (r *JobService)

NewJobService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type Location

type Location struct {
	// City, district, suburb, town, or village.
	City string `json:"city,nullable"`
	// The 2-letter ISO 3166 country code.
	Country string `json:"country,nullable"`
	// Street address or PO box.
	Line1 string `json:"line1,nullable"`
	// Apartment, suite, unit, or building.
	Line2 string `json:"line2,nullable"`
	Name  string `json:"name,nullable"`
	// The postal code or zip code.
	PostalCode string `json:"postal_code,nullable"`
	SourceID   string `json:"source_id,nullable"`
	// The state code.
	State string       `json:"state,nullable"`
	JSON  locationJSON `json:"-"`
}

func (*Location) UnmarshalJSON

func (r *Location) UnmarshalJSON(data []byte) (err error)

type LocationParam added in v0.8.0

type LocationParam struct {
	// City, district, suburb, town, or village.
	City param.Field[string] `json:"city"`
	// The 2-letter ISO 3166 country code.
	Country param.Field[string] `json:"country"`
	// Street address or PO box.
	Line1 param.Field[string] `json:"line1"`
	// Apartment, suite, unit, or building.
	Line2 param.Field[string] `json:"line2"`
	Name  param.Field[string] `json:"name"`
	// The postal code or zip code.
	PostalCode param.Field[string] `json:"postal_code"`
	SourceID   param.Field[string] `json:"source_id"`
	// The state code.
	State param.Field[string] `json:"state"`
}

func (LocationParam) MarshalJSON added in v0.8.0

func (r LocationParam) MarshalJSON() (data []byte, err error)

type ManualAsyncJob added in v0.7.0

type ManualAsyncJob struct {
	// Specific information about the job, such as individual statuses for batch jobs.
	Body   []interface{}        `json:"body,required,nullable"`
	JobID  string               `json:"job_id,required" format:"uuid"`
	Status ManualAsyncJobStatus `json:"status,required"`
	JSON   manualAsyncJobJSON   `json:"-"`
}

func (*ManualAsyncJob) UnmarshalJSON added in v0.7.0

func (r *ManualAsyncJob) UnmarshalJSON(data []byte) (err error)

type ManualAsyncJobStatus added in v0.7.0

type ManualAsyncJobStatus string
const (
	ManualAsyncJobStatusPending    ManualAsyncJobStatus = "pending"
	ManualAsyncJobStatusInProgress ManualAsyncJobStatus = "in_progress"
	ManualAsyncJobStatusError      ManualAsyncJobStatus = "error"
	ManualAsyncJobStatusComplete   ManualAsyncJobStatus = "complete"
)

func (ManualAsyncJobStatus) IsKnown added in v0.16.0

func (r ManualAsyncJobStatus) IsKnown() bool

type Money

type Money struct {
	// Amount for money object (in cents)
	Amount   int64     `json:"amount,nullable"`
	Currency string    `json:"currency"`
	JSON     moneyJSON `json:"-"`
}

func (*Money) UnmarshalJSON

func (r *Money) UnmarshalJSON(data []byte) (err error)

type MoneyParam added in v0.8.0

type MoneyParam struct {
	// Amount for money object (in cents)
	Amount   param.Field[int64]  `json:"amount"`
	Currency param.Field[string] `json:"currency"`
}

func (MoneyParam) MarshalJSON added in v0.8.0

func (r MoneyParam) MarshalJSON() (data []byte, err error)

type OperationSupport added in v0.5.0

type OperationSupport = shared.OperationSupport
  • `supported`: This operation is supported by both the provider and Finch
  • `not_supported_by_finch`: This operation is not supported by Finch but supported by the provider
  • `not_supported_by_provider`: This operation is not supported by the provider, so Finch cannot support
  • `client_access_only`: This behavior is supported by the provider, but only available to the client and not to Finch

This is an alias to an internal type.

type OperationSupportMatrix added in v0.5.0

type OperationSupportMatrix = shared.OperationSupportMatrix

This is an alias to an internal type.

type Paging

type Paging = shared.Paging

This is an alias to an internal type.

type PayStatement

type PayStatement struct {
	// The array of earnings objects associated with this pay statement
	Earnings []PayStatementEarning `json:"earnings,nullable"`
	// The array of deductions objects associated with this pay statement.
	EmployeeDeductions    []PayStatementEmployeeDeduction    `json:"employee_deductions,nullable"`
	EmployerContributions []PayStatementEmployerContribution `json:"employer_contributions,nullable"`
	GrossPay              Money                              `json:"gross_pay,nullable"`
	// A stable Finch `id` (UUID v4) for an individual in the company
	IndividualID string `json:"individual_id"`
	NetPay       Money  `json:"net_pay,nullable"`
	// The payment method.
	PaymentMethod PayStatementPaymentMethod `json:"payment_method,nullable"`
	// The array of taxes objects associated with this pay statement.
	Taxes []PayStatementTax `json:"taxes,nullable"`
	// The number of hours worked for this pay period
	TotalHours float64 `json:"total_hours,nullable"`
	// The type of the payment associated with the pay statement.
	Type PayStatementType `json:"type,nullable"`
	JSON payStatementJSON `json:"-"`
}

func (*PayStatement) UnmarshalJSON

func (r *PayStatement) UnmarshalJSON(data []byte) (err error)

type PayStatementEarning

type PayStatementEarning struct {
	// The earnings amount in cents.
	Amount int64 `json:"amount,nullable"`
	// The earnings currency code.
	Currency string `json:"currency,nullable"`
	// The number of hours associated with this earning. (For salaried employees, this
	// could be hours per pay period, `0` or `null`, depending on the provider).
	Hours float64 `json:"hours,nullable"`
	// The exact name of the deduction from the pay statement.
	Name string `json:"name,nullable"`
	// The type of earning.
	Type PayStatementEarningsType `json:"type,nullable"`
	JSON payStatementEarningJSON  `json:"-"`
}

func (*PayStatementEarning) UnmarshalJSON

func (r *PayStatementEarning) UnmarshalJSON(data []byte) (err error)

type PayStatementEarningsType

type PayStatementEarningsType string

The type of earning.

const (
	PayStatementEarningsTypeSalary         PayStatementEarningsType = "salary"
	PayStatementEarningsTypeWage           PayStatementEarningsType = "wage"
	PayStatementEarningsTypeReimbursement  PayStatementEarningsType = "reimbursement"
	PayStatementEarningsTypeOvertime       PayStatementEarningsType = "overtime"
	PayStatementEarningsTypeSeverance      PayStatementEarningsType = "severance"
	PayStatementEarningsTypeDoubleOvertime PayStatementEarningsType = "double_overtime"
	PayStatementEarningsTypePto            PayStatementEarningsType = "pto"
	PayStatementEarningsTypeSick           PayStatementEarningsType = "sick"
	PayStatementEarningsTypeBonus          PayStatementEarningsType = "bonus"
	PayStatementEarningsTypeCommission     PayStatementEarningsType = "commission"
	PayStatementEarningsTypeTips           PayStatementEarningsType = "tips"
	PayStatementEarningsType1099           PayStatementEarningsType = "1099"
	PayStatementEarningsTypeOther          PayStatementEarningsType = "other"
)

func (PayStatementEarningsType) IsKnown added in v0.16.0

func (r PayStatementEarningsType) IsKnown() bool

type PayStatementEmployeeDeduction

type PayStatementEmployeeDeduction struct {
	// The deduction amount in cents.
	Amount int64 `json:"amount,nullable"`
	// The deduction currency.
	Currency string `json:"currency,nullable"`
	// The deduction name from the pay statement.
	Name string `json:"name,nullable"`
	// Boolean indicating if the deduction is pre-tax.
	PreTax bool `json:"pre_tax,nullable"`
	// Type of benefit.
	Type BenefitType                       `json:"type,nullable"`
	JSON payStatementEmployeeDeductionJSON `json:"-"`
}

func (*PayStatementEmployeeDeduction) UnmarshalJSON

func (r *PayStatementEmployeeDeduction) UnmarshalJSON(data []byte) (err error)

type PayStatementEmployerContribution

type PayStatementEmployerContribution struct {
	// The contribution amount in cents.
	Amount int64 `json:"amount,nullable"`
	// The contribution currency.
	Currency string `json:"currency,nullable"`
	// The contribution name from the pay statement.
	Name string `json:"name,nullable"`
	// Type of benefit.
	Type BenefitType                          `json:"type,nullable"`
	JSON payStatementEmployerContributionJSON `json:"-"`
}

func (*PayStatementEmployerContribution) UnmarshalJSON

func (r *PayStatementEmployerContribution) UnmarshalJSON(data []byte) (err error)

type PayStatementEvent added in v0.10.0

type PayStatementEvent struct {
	Data      PayStatementEventData      `json:"data"`
	EventType PayStatementEventEventType `json:"event_type"`
	JSON      payStatementEventJSON      `json:"-"`
	BaseWebhookEvent
}

func (*PayStatementEvent) UnmarshalJSON added in v0.10.0

func (r *PayStatementEvent) UnmarshalJSON(data []byte) (err error)

type PayStatementEventData added in v0.10.0

type PayStatementEventData struct {
	// The ID of the individual associated with the pay statement.
	IndividualID string `json:"individual_id"`
	// The ID of the payment associated with the pay statement.
	PaymentID string                    `json:"payment_id"`
	JSON      payStatementEventDataJSON `json:"-"`
}

func (*PayStatementEventData) UnmarshalJSON added in v0.10.0

func (r *PayStatementEventData) UnmarshalJSON(data []byte) (err error)

type PayStatementEventEventType added in v0.10.0

type PayStatementEventEventType string
const (
	PayStatementEventEventTypePayStatementCreated PayStatementEventEventType = "pay_statement.created"
	PayStatementEventEventTypePayStatementUpdated PayStatementEventEventType = "pay_statement.updated"
	PayStatementEventEventTypePayStatementDeleted PayStatementEventEventType = "pay_statement.deleted"
)

func (PayStatementEventEventType) IsKnown added in v0.16.0

func (r PayStatementEventEventType) IsKnown() bool

type PayStatementPaymentMethod

type PayStatementPaymentMethod string

The payment method.

const (
	PayStatementPaymentMethodCheck         PayStatementPaymentMethod = "check"
	PayStatementPaymentMethodDirectDeposit PayStatementPaymentMethod = "direct_deposit"
)

func (PayStatementPaymentMethod) IsKnown added in v0.16.0

func (r PayStatementPaymentMethod) IsKnown() bool

type PayStatementResponse

type PayStatementResponse struct {
	Body      PayStatementResponseBody `json:"body"`
	Code      int64                    `json:"code"`
	PaymentID string                   `json:"payment_id"`
	JSON      payStatementResponseJSON `json:"-"`
}

func (*PayStatementResponse) UnmarshalJSON

func (r *PayStatementResponse) UnmarshalJSON(data []byte) (err error)

type PayStatementResponseBody

type PayStatementResponseBody struct {
	Paging shared.Paging `json:"paging"`
	// The array of pay statements for the current payment.
	PayStatements []PayStatement               `json:"pay_statements"`
	JSON          payStatementResponseBodyJSON `json:"-"`
}

func (*PayStatementResponseBody) UnmarshalJSON

func (r *PayStatementResponseBody) UnmarshalJSON(data []byte) (err error)

type PayStatementTax

type PayStatementTax struct {
	// The tax amount in cents.
	Amount int64 `json:"amount,nullable"`
	// The currency code.
	Currency string `json:"currency,nullable"`
	// `true` if the amount is paid by the employers.
	Employer bool `json:"employer,nullable"`
	// The exact name of tax from the pay statement.
	Name string `json:"name,nullable"`
	// The type of taxes.
	Type PayStatementTaxesType `json:"type,nullable"`
	JSON payStatementTaxJSON   `json:"-"`
}

func (*PayStatementTax) UnmarshalJSON

func (r *PayStatementTax) UnmarshalJSON(data []byte) (err error)

type PayStatementTaxesType

type PayStatementTaxesType string

The type of taxes.

const (
	PayStatementTaxesTypeState   PayStatementTaxesType = "state"
	PayStatementTaxesTypeFederal PayStatementTaxesType = "federal"
	PayStatementTaxesTypeLocal   PayStatementTaxesType = "local"
	PayStatementTaxesTypeFica    PayStatementTaxesType = "fica"
)

func (PayStatementTaxesType) IsKnown added in v0.16.0

func (r PayStatementTaxesType) IsKnown() bool

type PayStatementType

type PayStatementType string

The type of the payment associated with the pay statement.

const (
	PayStatementTypeRegularPayroll  PayStatementType = "regular_payroll"
	PayStatementTypeOffCyclePayroll PayStatementType = "off_cycle_payroll"
	PayStatementTypeOneTimePayment  PayStatementType = "one_time_payment"
)

func (PayStatementType) IsKnown added in v0.16.0

func (r PayStatementType) IsKnown() bool

type Payment

type Payment struct {
	// The unique id for the payment.
	ID            string `json:"id"`
	CompanyDebit  Money  `json:"company_debit,nullable"`
	DebitDate     string `json:"debit_date,nullable"`
	EmployeeTaxes Money  `json:"employee_taxes,nullable"`
	EmployerTaxes Money  `json:"employer_taxes,nullable"`
	GrossPay      Money  `json:"gross_pay,nullable"`
	// Array of every individual on this payment.
	IndividualIDs []string `json:"individual_ids,nullable"`
	NetPay        Money    `json:"net_pay,nullable"`
	PayDate       string   `json:"pay_date,nullable"`
	// The pay period object.
	PayPeriod PaymentPayPeriod `json:"pay_period,nullable"`
	JSON      paymentJSON      `json:"-"`
}

func (*Payment) UnmarshalJSON

func (r *Payment) UnmarshalJSON(data []byte) (err error)

type PaymentEvent added in v0.10.0

type PaymentEvent struct {
	Data      PaymentEventData      `json:"data"`
	EventType PaymentEventEventType `json:"event_type"`
	JSON      paymentEventJSON      `json:"-"`
	BaseWebhookEvent
}

func (*PaymentEvent) UnmarshalJSON added in v0.10.0

func (r *PaymentEvent) UnmarshalJSON(data []byte) (err error)

type PaymentEventData added in v0.10.0

type PaymentEventData struct {
	// The date of the payment.
	PayDate string `json:"pay_date,required"`
	// The ID of the payment.
	PaymentID string               `json:"payment_id,required"`
	JSON      paymentEventDataJSON `json:"-"`
}

func (*PaymentEventData) UnmarshalJSON added in v0.10.0

func (r *PaymentEventData) UnmarshalJSON(data []byte) (err error)

type PaymentEventEventType added in v0.10.0

type PaymentEventEventType string
const (
	PaymentEventEventTypePaymentCreated PaymentEventEventType = "payment.created"
	PaymentEventEventTypePaymentUpdated PaymentEventEventType = "payment.updated"
	PaymentEventEventTypePaymentDeleted PaymentEventEventType = "payment.deleted"
)

func (PaymentEventEventType) IsKnown added in v0.16.0

func (r PaymentEventEventType) IsKnown() bool

type PaymentPayPeriod

type PaymentPayPeriod struct {
	EndDate   string               `json:"end_date,nullable"`
	StartDate string               `json:"start_date,nullable"`
	JSON      paymentPayPeriodJSON `json:"-"`
}

The pay period object.

func (*PaymentPayPeriod) UnmarshalJSON

func (r *PaymentPayPeriod) UnmarshalJSON(data []byte) (err error)

type Provider

type Provider struct {
	// The id of the payroll provider used in Connect.
	ID string `json:"id"`
	// The list of authentication methods supported by the provider.
	AuthenticationMethods []ProviderAuthenticationMethod `json:"authentication_methods"`
	// The display name of the payroll provider.
	DisplayName string `json:"display_name"`
	// The url to the official icon of the payroll provider.
	Icon string `json:"icon"`
	Logo string `json:"logo"`
	// [DEPRECATED] Whether the Finch integration with this provider uses the Assisted
	// Connect Flow by default. This field is now deprecated. Please check for a `type`
	// of `assisted` in the `authentication_methods` field instead.
	Manual bool `json:"manual"`
	// whether MFA is required for the provider.
	MfaRequired bool `json:"mfa_required"`
	// The hex code for the primary color of the payroll provider.
	PrimaryColor string `json:"primary_color"`
	// The list of Finch products supported on this payroll provider.
	Products []string     `json:"products"`
	JSON     providerJSON `json:"-"`
}

func (*Provider) UnmarshalJSON

func (r *Provider) UnmarshalJSON(data []byte) (err error)

type ProviderAuthenticationMethod added in v0.5.0

type ProviderAuthenticationMethod struct {
	// Each benefit type and their supported features. If the benefit type is not
	// supported, the property will be null
	BenefitsSupport BenefitsSupport `json:"benefits_support,nullable"`
	// The supported data fields returned by our HR and payroll endpoints
	SupportedFields ProviderAuthenticationMethodsSupportedFields `json:"supported_fields,nullable"`
	// The type of authentication method.
	Type ProviderAuthenticationMethodsType `json:"type"`
	JSON providerAuthenticationMethodJSON  `json:"-"`
}

func (*ProviderAuthenticationMethod) UnmarshalJSON added in v0.5.0

func (r *ProviderAuthenticationMethod) UnmarshalJSON(data []byte) (err error)

type ProviderAuthenticationMethodsSupportedFields added in v0.5.0

type ProviderAuthenticationMethodsSupportedFields struct {
	Company      ProviderAuthenticationMethodsSupportedFieldsCompany      `json:"company"`
	Directory    ProviderAuthenticationMethodsSupportedFieldsDirectory    `json:"directory"`
	Employment   ProviderAuthenticationMethodsSupportedFieldsEmployment   `json:"employment"`
	Individual   ProviderAuthenticationMethodsSupportedFieldsIndividual   `json:"individual"`
	PayStatement ProviderAuthenticationMethodsSupportedFieldsPayStatement `json:"pay_statement"`
	Payment      ProviderAuthenticationMethodsSupportedFieldsPayment      `json:"payment"`
	JSON         providerAuthenticationMethodsSupportedFieldsJSON         `json:"-"`
}

The supported data fields returned by our HR and payroll endpoints

func (*ProviderAuthenticationMethodsSupportedFields) UnmarshalJSON added in v0.5.0

func (r *ProviderAuthenticationMethodsSupportedFields) UnmarshalJSON(data []byte) (err error)

type ProviderAuthenticationMethodsSupportedFieldsCompany added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsCompany struct {
	ID                 bool                                                           `json:"id"`
	Accounts           ProviderAuthenticationMethodsSupportedFieldsCompanyAccounts    `json:"accounts"`
	Departments        ProviderAuthenticationMethodsSupportedFieldsCompanyDepartments `json:"departments"`
	Ein                bool                                                           `json:"ein"`
	Entity             ProviderAuthenticationMethodsSupportedFieldsCompanyEntity      `json:"entity"`
	LegalName          bool                                                           `json:"legal_name"`
	Locations          ProviderAuthenticationMethodsSupportedFieldsCompanyLocations   `json:"locations"`
	PrimaryEmail       bool                                                           `json:"primary_email"`
	PrimaryPhoneNumber bool                                                           `json:"primary_phone_number"`
	JSON               providerAuthenticationMethodsSupportedFieldsCompanyJSON        `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsCompany) UnmarshalJSON added in v0.5.0

func (r *ProviderAuthenticationMethodsSupportedFieldsCompany) UnmarshalJSON(data []byte) (err error)

type ProviderAuthenticationMethodsSupportedFieldsCompanyAccounts added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsCompanyAccounts struct {
	AccountName     bool                                                            `json:"account_name"`
	AccountNumber   bool                                                            `json:"account_number"`
	AccountType     bool                                                            `json:"account_type"`
	InstitutionName bool                                                            `json:"institution_name"`
	RoutingNumber   bool                                                            `json:"routing_number"`
	JSON            providerAuthenticationMethodsSupportedFieldsCompanyAccountsJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsCompanyAccounts) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsCompanyDepartments added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsCompanyDepartments struct {
	Name   bool                                                                 `json:"name"`
	Parent ProviderAuthenticationMethodsSupportedFieldsCompanyDepartmentsParent `json:"parent"`
	JSON   providerAuthenticationMethodsSupportedFieldsCompanyDepartmentsJSON   `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsCompanyDepartments) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsCompanyDepartmentsParent added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsCompanyDepartmentsParent struct {
	Name bool                                                                     `json:"name"`
	JSON providerAuthenticationMethodsSupportedFieldsCompanyDepartmentsParentJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsCompanyDepartmentsParent) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsCompanyEntity added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsCompanyEntity struct {
	Subtype bool                                                          `json:"subtype"`
	Type    bool                                                          `json:"type"`
	JSON    providerAuthenticationMethodsSupportedFieldsCompanyEntityJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsCompanyEntity) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsCompanyLocations added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsCompanyLocations struct {
	City       bool                                                             `json:"city"`
	Country    bool                                                             `json:"country"`
	Line1      bool                                                             `json:"line1"`
	Line2      bool                                                             `json:"line2"`
	PostalCode bool                                                             `json:"postal_code"`
	State      bool                                                             `json:"state"`
	JSON       providerAuthenticationMethodsSupportedFieldsCompanyLocationsJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsCompanyLocations) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsDirectory added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsDirectory struct {
	Individuals ProviderAuthenticationMethodsSupportedFieldsDirectoryIndividuals `json:"individuals"`
	Paging      ProviderAuthenticationMethodsSupportedFieldsDirectoryPaging      `json:"paging"`
	JSON        providerAuthenticationMethodsSupportedFieldsDirectoryJSON        `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsDirectory) UnmarshalJSON added in v0.5.0

func (r *ProviderAuthenticationMethodsSupportedFieldsDirectory) UnmarshalJSON(data []byte) (err error)

type ProviderAuthenticationMethodsSupportedFieldsDirectoryIndividuals added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsDirectoryIndividuals struct {
	ID         bool                                                                    `json:"id"`
	Department bool                                                                    `json:"department"`
	FirstName  bool                                                                    `json:"first_name"`
	IsActive   bool                                                                    `json:"is_active"`
	LastName   bool                                                                    `json:"last_name"`
	Manager    ProviderAuthenticationMethodsSupportedFieldsDirectoryIndividualsManager `json:"manager"`
	MiddleName bool                                                                    `json:"middle_name"`
	JSON       providerAuthenticationMethodsSupportedFieldsDirectoryIndividualsJSON    `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsDirectoryIndividuals) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsDirectoryIndividualsManager added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsDirectoryIndividualsManager struct {
	ID   bool                                                                        `json:"id"`
	JSON providerAuthenticationMethodsSupportedFieldsDirectoryIndividualsManagerJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsDirectoryIndividualsManager) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsDirectoryPaging added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsDirectoryPaging struct {
	Count  bool                                                            `json:"count"`
	Offset bool                                                            `json:"offset"`
	JSON   providerAuthenticationMethodsSupportedFieldsDirectoryPagingJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsDirectoryPaging) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsEmployment added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsEmployment struct {
	ID            bool                                                             `json:"id"`
	ClassCode     bool                                                             `json:"class_code"`
	CustomFields  bool                                                             `json:"custom_fields"`
	Department    ProviderAuthenticationMethodsSupportedFieldsEmploymentDepartment `json:"department"`
	Employment    ProviderAuthenticationMethodsSupportedFieldsEmploymentEmployment `json:"employment"`
	EndDate       bool                                                             `json:"end_date"`
	FirstName     bool                                                             `json:"first_name"`
	Income        ProviderAuthenticationMethodsSupportedFieldsEmploymentIncome     `json:"income"`
	IncomeHistory bool                                                             `json:"income_history"`
	IsActive      bool                                                             `json:"is_active"`
	LastName      bool                                                             `json:"last_name"`
	Location      ProviderAuthenticationMethodsSupportedFieldsEmploymentLocation   `json:"location"`
	Manager       ProviderAuthenticationMethodsSupportedFieldsEmploymentManager    `json:"manager"`
	MiddleName    bool                                                             `json:"middle_name"`
	StartDate     bool                                                             `json:"start_date"`
	Title         bool                                                             `json:"title"`
	JSON          providerAuthenticationMethodsSupportedFieldsEmploymentJSON       `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsEmployment) UnmarshalJSON added in v0.5.0

func (r *ProviderAuthenticationMethodsSupportedFieldsEmployment) UnmarshalJSON(data []byte) (err error)

type ProviderAuthenticationMethodsSupportedFieldsEmploymentDepartment added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsEmploymentDepartment struct {
	Name bool                                                                 `json:"name"`
	JSON providerAuthenticationMethodsSupportedFieldsEmploymentDepartmentJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsEmploymentDepartment) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsEmploymentEmployment added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsEmploymentEmployment struct {
	Subtype bool                                                                 `json:"subtype"`
	Type    bool                                                                 `json:"type"`
	JSON    providerAuthenticationMethodsSupportedFieldsEmploymentEmploymentJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsEmploymentEmployment) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsEmploymentIncome added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsEmploymentIncome struct {
	Amount   bool                                                             `json:"amount"`
	Currency bool                                                             `json:"currency"`
	Unit     bool                                                             `json:"unit"`
	JSON     providerAuthenticationMethodsSupportedFieldsEmploymentIncomeJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsEmploymentIncome) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsEmploymentLocation added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsEmploymentLocation struct {
	City       bool                                                               `json:"city"`
	Country    bool                                                               `json:"country"`
	Line1      bool                                                               `json:"line1"`
	Line2      bool                                                               `json:"line2"`
	PostalCode bool                                                               `json:"postal_code"`
	State      bool                                                               `json:"state"`
	JSON       providerAuthenticationMethodsSupportedFieldsEmploymentLocationJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsEmploymentLocation) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsEmploymentManager added in v0.6.0

type ProviderAuthenticationMethodsSupportedFieldsEmploymentManager struct {
	ID   bool                                                              `json:"id"`
	JSON providerAuthenticationMethodsSupportedFieldsEmploymentManagerJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsEmploymentManager) UnmarshalJSON added in v0.6.0

type ProviderAuthenticationMethodsSupportedFieldsIndividual added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsIndividual struct {
	ID            bool                                                               `json:"id"`
	Dob           bool                                                               `json:"dob"`
	Emails        ProviderAuthenticationMethodsSupportedFieldsIndividualEmails       `json:"emails"`
	EncryptedSsn  bool                                                               `json:"encrypted_ssn"`
	Ethnicity     bool                                                               `json:"ethnicity"`
	FirstName     bool                                                               `json:"first_name"`
	Gender        bool                                                               `json:"gender"`
	LastName      bool                                                               `json:"last_name"`
	MiddleName    bool                                                               `json:"middle_name"`
	PhoneNumbers  ProviderAuthenticationMethodsSupportedFieldsIndividualPhoneNumbers `json:"phone_numbers"`
	PreferredName bool                                                               `json:"preferred_name"`
	Residence     ProviderAuthenticationMethodsSupportedFieldsIndividualResidence    `json:"residence"`
	Ssn           bool                                                               `json:"ssn"`
	JSON          providerAuthenticationMethodsSupportedFieldsIndividualJSON         `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsIndividual) UnmarshalJSON added in v0.5.0

func (r *ProviderAuthenticationMethodsSupportedFieldsIndividual) UnmarshalJSON(data []byte) (err error)

type ProviderAuthenticationMethodsSupportedFieldsIndividualEmails added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsIndividualEmails struct {
	Data bool                                                             `json:"data"`
	Type bool                                                             `json:"type"`
	JSON providerAuthenticationMethodsSupportedFieldsIndividualEmailsJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsIndividualEmails) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsIndividualPhoneNumbers added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsIndividualPhoneNumbers struct {
	Data bool                                                                   `json:"data"`
	Type bool                                                                   `json:"type"`
	JSON providerAuthenticationMethodsSupportedFieldsIndividualPhoneNumbersJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsIndividualPhoneNumbers) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsIndividualResidence added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsIndividualResidence struct {
	City       bool                                                                `json:"city"`
	Country    bool                                                                `json:"country"`
	Line1      bool                                                                `json:"line1"`
	Line2      bool                                                                `json:"line2"`
	PostalCode bool                                                                `json:"postal_code"`
	State      bool                                                                `json:"state"`
	JSON       providerAuthenticationMethodsSupportedFieldsIndividualResidenceJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsIndividualResidence) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatement added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatement struct {
	Paging        ProviderAuthenticationMethodsSupportedFieldsPayStatementPaging        `json:"paging"`
	PayStatements ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatements `json:"pay_statements"`
	JSON          providerAuthenticationMethodsSupportedFieldsPayStatementJSON          `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsPayStatement) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPaging added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPaging struct {
	Count  bool                                                               `json:"count,required"`
	Offset bool                                                               `json:"offset,required"`
	JSON   providerAuthenticationMethodsSupportedFieldsPayStatementPagingJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsPayStatementPaging) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatements added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatements struct {
	Earnings              ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEarnings              `json:"earnings"`
	EmployeeDeductions    ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployeeDeductions    `json:"employee_deductions"`
	EmployerContributions ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployerContributions `json:"employer_contributions"`
	// [DEPRECATED] Use `employer_contributions` instead
	EmployerDeductions ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployerDeductions `json:"employer_deductions"`
	GrossPay           bool                                                                                    `json:"gross_pay"`
	IndividualID       bool                                                                                    `json:"individual_id"`
	NetPay             bool                                                                                    `json:"net_pay"`
	PaymentMethod      bool                                                                                    `json:"payment_method"`
	Taxes              ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsTaxes              `json:"taxes"`
	TotalHours         bool                                                                                    `json:"total_hours"`
	Type               bool                                                                                    `json:"type"`
	JSON               providerAuthenticationMethodsSupportedFieldsPayStatementPayStatementsJSON               `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatements) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEarnings added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEarnings struct {
	Amount   bool                                                                              `json:"amount"`
	Currency bool                                                                              `json:"currency"`
	Name     bool                                                                              `json:"name"`
	Type     bool                                                                              `json:"type"`
	JSON     providerAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEarningsJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEarnings) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployeeDeductions added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployeeDeductions struct {
	Amount   bool                                                                                        `json:"amount"`
	Currency bool                                                                                        `json:"currency"`
	Name     bool                                                                                        `json:"name"`
	PreTax   bool                                                                                        `json:"pre_tax"`
	Type     bool                                                                                        `json:"type"`
	JSON     providerAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployeeDeductionsJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployeeDeductions) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployerContributions added in v0.10.1

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployerContributions struct {
	Amount   bool                                                                                           `json:"amount"`
	Currency bool                                                                                           `json:"currency"`
	Name     bool                                                                                           `json:"name"`
	JSON     providerAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployerContributionsJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployerContributions) UnmarshalJSON added in v0.10.1

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployerDeductions added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployerDeductions struct {
	Amount   bool                                                                                        `json:"amount"`
	Currency bool                                                                                        `json:"currency"`
	Name     bool                                                                                        `json:"name"`
	JSON     providerAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployerDeductionsJSON `json:"-"`
}

[DEPRECATED] Use `employer_contributions` instead

func (*ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsEmployerDeductions) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsTaxes added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsTaxes struct {
	Amount   bool                                                                           `json:"amount"`
	Currency bool                                                                           `json:"currency"`
	Employer bool                                                                           `json:"employer"`
	Name     bool                                                                           `json:"name"`
	Type     bool                                                                           `json:"type"`
	JSON     providerAuthenticationMethodsSupportedFieldsPayStatementPayStatementsTaxesJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsPayStatementPayStatementsTaxes) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayment added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPayment struct {
	ID            bool                                                         `json:"id"`
	CompanyDebit  bool                                                         `json:"company_debit"`
	DebitDate     bool                                                         `json:"debit_date"`
	EmployeeTaxes bool                                                         `json:"employee_taxes"`
	EmployerTaxes bool                                                         `json:"employer_taxes"`
	GrossPay      bool                                                         `json:"gross_pay"`
	IndividualIDs bool                                                         `json:"individual_ids"`
	NetPay        bool                                                         `json:"net_pay"`
	PayDate       bool                                                         `json:"pay_date"`
	PayPeriod     ProviderAuthenticationMethodsSupportedFieldsPaymentPayPeriod `json:"pay_period"`
	JSON          providerAuthenticationMethodsSupportedFieldsPaymentJSON      `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsPayment) UnmarshalJSON added in v0.5.0

func (r *ProviderAuthenticationMethodsSupportedFieldsPayment) UnmarshalJSON(data []byte) (err error)

type ProviderAuthenticationMethodsSupportedFieldsPaymentPayPeriod added in v0.5.0

type ProviderAuthenticationMethodsSupportedFieldsPaymentPayPeriod struct {
	EndDate   bool                                                             `json:"end_date"`
	StartDate bool                                                             `json:"start_date"`
	JSON      providerAuthenticationMethodsSupportedFieldsPaymentPayPeriodJSON `json:"-"`
}

func (*ProviderAuthenticationMethodsSupportedFieldsPaymentPayPeriod) UnmarshalJSON added in v0.5.0

type ProviderAuthenticationMethodsType added in v0.5.0

type ProviderAuthenticationMethodsType string

The type of authentication method.

const (
	ProviderAuthenticationMethodsTypeAssisted      ProviderAuthenticationMethodsType = "assisted"
	ProviderAuthenticationMethodsTypeCredential    ProviderAuthenticationMethodsType = "credential"
	ProviderAuthenticationMethodsTypeAPIToken      ProviderAuthenticationMethodsType = "api_token"
	ProviderAuthenticationMethodsTypeAPICredential ProviderAuthenticationMethodsType = "api_credential"
	ProviderAuthenticationMethodsTypeOAuth         ProviderAuthenticationMethodsType = "oauth"
)

func (ProviderAuthenticationMethodsType) IsKnown added in v0.16.0

type ProviderService

type ProviderService struct {
	Options []option.RequestOption
}

ProviderService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProviderService method instead.

func NewProviderService

func NewProviderService(opts ...option.RequestOption) (r *ProviderService)

NewProviderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProviderService) List

Return details on all available payroll and HR systems.

func (*ProviderService) ListAutoPaging

Return details on all available payroll and HR systems.

type RequestForwardingForwardParams added in v0.0.5

type RequestForwardingForwardParams struct {
	// The HTTP method for the forwarded request. Valid values include: `GET` , `POST`
	// , `PUT` , `DELETE` , and `PATCH`.
	Method param.Field[string] `json:"method,required"`
	// 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.
	Route param.Field[string] `json:"route,required"`
	// The body for the forwarded request. This value must be specified as either a
	// string or a valid JSON object.
	Data param.Field[string] `json:"data"`
	// 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" }`
	Headers param.Field[interface{}] `json:"headers"`
	// The query parameters for the forwarded request. This value must be specified as
	// a valid JSON object rather than a query string.
	Params param.Field[interface{}] `json:"params"`
}

func (RequestForwardingForwardParams) MarshalJSON added in v0.0.5

func (r RequestForwardingForwardParams) MarshalJSON() (data []byte, err error)

type RequestForwardingForwardResponse added in v0.0.5

type RequestForwardingForwardResponse struct {
	// A string representation of the HTTP response body of the forwarded request’s
	// response received from the underlying integration’s API. This field may be null
	// in the case where the upstream system’s response is empty.
	Data string `json:"data,required,nullable"`
	// The HTTP headers of the forwarded request’s response, exactly as received from
	// the underlying integration’s API.
	Headers interface{} `json:"headers,required,nullable"`
	// An object containing details of your original forwarded request, for your ease
	// of reference.
	Request RequestForwardingForwardResponseRequest `json:"request,required"`
	// The HTTP status code of the forwarded request’s response, exactly received from
	// the underlying integration’s API. This value will be returned as an integer.
	StatusCode int64                                `json:"statusCode,required"`
	JSON       requestForwardingForwardResponseJSON `json:"-"`
}

func (*RequestForwardingForwardResponse) UnmarshalJSON added in v0.0.5

func (r *RequestForwardingForwardResponse) UnmarshalJSON(data []byte) (err error)

type RequestForwardingForwardResponseRequest added in v0.0.5

type RequestForwardingForwardResponseRequest struct {
	// The body that was specified for the forwarded request. If a value was not
	// specified in the original request, this value will be returned as null ;
	// otherwise, this value will always be returned as a string.
	Data string `json:"data,required,nullable"`
	// The specified HTTP headers that were included in the forwarded request. If no
	// headers were specified, this will be returned as `null`.
	Headers interface{} `json:"headers,required,nullable"`
	// The HTTP method that was specified for the forwarded request. Valid values
	// include: `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`.
	Method string `json:"method,required"`
	// The query parameters that were included in the forwarded request. If no query
	// parameters were specified, this will be returned as `null`.
	Params interface{} `json:"params,required,nullable"`
	// The URL route path that was specified for the forwarded request.
	Route string                                      `json:"route,required"`
	JSON  requestForwardingForwardResponseRequestJSON `json:"-"`
}

An object containing details of your original forwarded request, for your ease of reference.

func (*RequestForwardingForwardResponseRequest) UnmarshalJSON added in v0.0.5

func (r *RequestForwardingForwardResponseRequest) UnmarshalJSON(data []byte) (err error)

type RequestForwardingService added in v0.0.5

type RequestForwardingService struct {
	Options []option.RequestOption
}

RequestForwardingService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRequestForwardingService method instead.

func NewRequestForwardingService added in v0.0.5

func NewRequestForwardingService(opts ...option.RequestOption) (r *RequestForwardingService)

NewRequestForwardingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RequestForwardingService) Forward added in v0.0.5

The Forward API allows you to make direct requests to an employment system. If Finch’s unified API doesn’t have a data model that cleanly fits your needs, then Forward allows you to push or pull data models directly against an integration’s API.

type SandboxCompanyService added in v0.8.0

type SandboxCompanyService struct {
	Options []option.RequestOption
}

SandboxCompanyService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSandboxCompanyService method instead.

func NewSandboxCompanyService added in v0.8.0

func NewSandboxCompanyService(opts ...option.RequestOption) (r *SandboxCompanyService)

NewSandboxCompanyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SandboxCompanyService) Update added in v0.8.0

Update a sandbox company's data

type SandboxCompanyUpdateParams added in v0.8.0

type SandboxCompanyUpdateParams struct {
	// An array of bank account objects associated with the payroll/HRIS system.
	Accounts param.Field[[]SandboxCompanyUpdateParamsAccount] `json:"accounts,required"`
	// The array of company departments.
	Departments param.Field[[]SandboxCompanyUpdateParamsDepartment] `json:"departments,required"`
	// The employer identification number.
	Ein param.Field[string] `json:"ein,required"`
	// The entity type object.
	Entity param.Field[SandboxCompanyUpdateParamsEntity] `json:"entity,required"`
	// The legal name of the company.
	LegalName param.Field[string]          `json:"legal_name,required"`
	Locations param.Field[[]LocationParam] `json:"locations,required"`
	// The email of the main administrator on the account.
	PrimaryEmail param.Field[string] `json:"primary_email,required"`
	// The phone number of the main administrator on the account. Format: `XXXXXXXXXX`
	PrimaryPhoneNumber param.Field[string] `json:"primary_phone_number,required"`
}

func (SandboxCompanyUpdateParams) MarshalJSON added in v0.8.0

func (r SandboxCompanyUpdateParams) MarshalJSON() (data []byte, err error)

type SandboxCompanyUpdateParamsAccount added in v0.8.0

type SandboxCompanyUpdateParamsAccount struct {
	// The name of the bank associated in the payroll/HRIS system.
	AccountName param.Field[string] `json:"account_name"`
	// 10-12 digit number to specify the bank account
	AccountNumber param.Field[string] `json:"account_number"`
	// The type of bank account.
	AccountType param.Field[SandboxCompanyUpdateParamsAccountsAccountType] `json:"account_type"`
	// Name of the banking institution.
	InstitutionName param.Field[string] `json:"institution_name"`
	// A nine-digit code that's based on the U.S. Bank location where your account was
	// opened.
	RoutingNumber param.Field[string] `json:"routing_number"`
}

func (SandboxCompanyUpdateParamsAccount) MarshalJSON added in v0.8.0

func (r SandboxCompanyUpdateParamsAccount) MarshalJSON() (data []byte, err error)

type SandboxCompanyUpdateParamsAccountsAccountType added in v0.8.0

type SandboxCompanyUpdateParamsAccountsAccountType string

The type of bank account.

const (
	SandboxCompanyUpdateParamsAccountsAccountTypeChecking SandboxCompanyUpdateParamsAccountsAccountType = "checking"
	SandboxCompanyUpdateParamsAccountsAccountTypeSavings  SandboxCompanyUpdateParamsAccountsAccountType = "savings"
)

func (SandboxCompanyUpdateParamsAccountsAccountType) IsKnown added in v0.16.0

type SandboxCompanyUpdateParamsDepartment added in v0.8.0

type SandboxCompanyUpdateParamsDepartment struct {
	// The department name.
	Name param.Field[string] `json:"name"`
	// The parent department, if present.
	Parent param.Field[SandboxCompanyUpdateParamsDepartmentsParent] `json:"parent"`
}

func (SandboxCompanyUpdateParamsDepartment) MarshalJSON added in v0.8.0

func (r SandboxCompanyUpdateParamsDepartment) MarshalJSON() (data []byte, err error)

type SandboxCompanyUpdateParamsDepartmentsParent added in v0.8.0

type SandboxCompanyUpdateParamsDepartmentsParent struct {
	// The parent department's name.
	Name param.Field[string] `json:"name"`
}

The parent department, if present.

func (SandboxCompanyUpdateParamsDepartmentsParent) MarshalJSON added in v0.8.0

func (r SandboxCompanyUpdateParamsDepartmentsParent) MarshalJSON() (data []byte, err error)

type SandboxCompanyUpdateParamsEntity added in v0.8.0

type SandboxCompanyUpdateParamsEntity struct {
	// The tax payer subtype of the company.
	Subtype param.Field[SandboxCompanyUpdateParamsEntitySubtype] `json:"subtype"`
	// The tax payer type of the company.
	Type param.Field[SandboxCompanyUpdateParamsEntityType] `json:"type"`
}

The entity type object.

func (SandboxCompanyUpdateParamsEntity) MarshalJSON added in v0.8.0

func (r SandboxCompanyUpdateParamsEntity) MarshalJSON() (data []byte, err error)

type SandboxCompanyUpdateParamsEntitySubtype added in v0.8.0

type SandboxCompanyUpdateParamsEntitySubtype string

The tax payer subtype of the company.

const (
	SandboxCompanyUpdateParamsEntitySubtypeSCorporation SandboxCompanyUpdateParamsEntitySubtype = "s_corporation"
	SandboxCompanyUpdateParamsEntitySubtypeCCorporation SandboxCompanyUpdateParamsEntitySubtype = "c_corporation"
	SandboxCompanyUpdateParamsEntitySubtypeBCorporation SandboxCompanyUpdateParamsEntitySubtype = "b_corporation"
)

func (SandboxCompanyUpdateParamsEntitySubtype) IsKnown added in v0.16.0

type SandboxCompanyUpdateParamsEntityType added in v0.8.0

type SandboxCompanyUpdateParamsEntityType string

The tax payer type of the company.

const (
	SandboxCompanyUpdateParamsEntityTypeLlc            SandboxCompanyUpdateParamsEntityType = "llc"
	SandboxCompanyUpdateParamsEntityTypeLp             SandboxCompanyUpdateParamsEntityType = "lp"
	SandboxCompanyUpdateParamsEntityTypeCorporation    SandboxCompanyUpdateParamsEntityType = "corporation"
	SandboxCompanyUpdateParamsEntityTypeSoleProprietor SandboxCompanyUpdateParamsEntityType = "sole_proprietor"
	SandboxCompanyUpdateParamsEntityTypeNonProfit      SandboxCompanyUpdateParamsEntityType = "non_profit"
	SandboxCompanyUpdateParamsEntityTypePartnership    SandboxCompanyUpdateParamsEntityType = "partnership"
	SandboxCompanyUpdateParamsEntityTypeCooperative    SandboxCompanyUpdateParamsEntityType = "cooperative"
)

func (SandboxCompanyUpdateParamsEntityType) IsKnown added in v0.16.0

type SandboxCompanyUpdateResponse added in v0.8.0

type SandboxCompanyUpdateResponse struct {
	// An array of bank account objects associated with the payroll/HRIS system.
	Accounts []SandboxCompanyUpdateResponseAccount `json:"accounts,required,nullable"`
	// The array of company departments.
	Departments []SandboxCompanyUpdateResponseDepartment `json:"departments,required,nullable"`
	// The employer identification number.
	Ein string `json:"ein,required,nullable"`
	// The entity type object.
	Entity SandboxCompanyUpdateResponseEntity `json:"entity,required,nullable"`
	// The legal name of the company.
	LegalName string     `json:"legal_name,required,nullable"`
	Locations []Location `json:"locations,required,nullable"`
	// The email of the main administrator on the account.
	PrimaryEmail string `json:"primary_email,required,nullable"`
	// The phone number of the main administrator on the account. Format: `XXXXXXXXXX`
	PrimaryPhoneNumber string                           `json:"primary_phone_number,required,nullable"`
	JSON               sandboxCompanyUpdateResponseJSON `json:"-"`
}

func (*SandboxCompanyUpdateResponse) UnmarshalJSON added in v0.8.0

func (r *SandboxCompanyUpdateResponse) UnmarshalJSON(data []byte) (err error)

type SandboxCompanyUpdateResponseAccount added in v0.8.0

type SandboxCompanyUpdateResponseAccount struct {
	// The name of the bank associated in the payroll/HRIS system.
	AccountName string `json:"account_name,nullable"`
	// 10-12 digit number to specify the bank account
	AccountNumber string `json:"account_number,nullable"`
	// The type of bank account.
	AccountType SandboxCompanyUpdateResponseAccountsAccountType `json:"account_type,nullable"`
	// Name of the banking institution.
	InstitutionName string `json:"institution_name,nullable"`
	// A nine-digit code that's based on the U.S. Bank location where your account was
	// opened.
	RoutingNumber string                                  `json:"routing_number,nullable"`
	JSON          sandboxCompanyUpdateResponseAccountJSON `json:"-"`
}

func (*SandboxCompanyUpdateResponseAccount) UnmarshalJSON added in v0.8.0

func (r *SandboxCompanyUpdateResponseAccount) UnmarshalJSON(data []byte) (err error)

type SandboxCompanyUpdateResponseAccountsAccountType added in v0.8.0

type SandboxCompanyUpdateResponseAccountsAccountType string

The type of bank account.

const (
	SandboxCompanyUpdateResponseAccountsAccountTypeChecking SandboxCompanyUpdateResponseAccountsAccountType = "checking"
	SandboxCompanyUpdateResponseAccountsAccountTypeSavings  SandboxCompanyUpdateResponseAccountsAccountType = "savings"
)

func (SandboxCompanyUpdateResponseAccountsAccountType) IsKnown added in v0.16.0

type SandboxCompanyUpdateResponseDepartment added in v0.8.0

type SandboxCompanyUpdateResponseDepartment struct {
	// The department name.
	Name string `json:"name,nullable"`
	// The parent department, if present.
	Parent SandboxCompanyUpdateResponseDepartmentsParent `json:"parent,nullable"`
	JSON   sandboxCompanyUpdateResponseDepartmentJSON    `json:"-"`
}

func (*SandboxCompanyUpdateResponseDepartment) UnmarshalJSON added in v0.8.0

func (r *SandboxCompanyUpdateResponseDepartment) UnmarshalJSON(data []byte) (err error)

type SandboxCompanyUpdateResponseDepartmentsParent added in v0.8.0

type SandboxCompanyUpdateResponseDepartmentsParent struct {
	// The parent department's name.
	Name string                                            `json:"name,nullable"`
	JSON sandboxCompanyUpdateResponseDepartmentsParentJSON `json:"-"`
}

The parent department, if present.

func (*SandboxCompanyUpdateResponseDepartmentsParent) UnmarshalJSON added in v0.8.0

func (r *SandboxCompanyUpdateResponseDepartmentsParent) UnmarshalJSON(data []byte) (err error)

type SandboxCompanyUpdateResponseEntity added in v0.8.0

type SandboxCompanyUpdateResponseEntity struct {
	// The tax payer subtype of the company.
	Subtype SandboxCompanyUpdateResponseEntitySubtype `json:"subtype,nullable"`
	// The tax payer type of the company.
	Type SandboxCompanyUpdateResponseEntityType `json:"type,nullable"`
	JSON sandboxCompanyUpdateResponseEntityJSON `json:"-"`
}

The entity type object.

func (*SandboxCompanyUpdateResponseEntity) UnmarshalJSON added in v0.8.0

func (r *SandboxCompanyUpdateResponseEntity) UnmarshalJSON(data []byte) (err error)

type SandboxCompanyUpdateResponseEntitySubtype added in v0.8.0

type SandboxCompanyUpdateResponseEntitySubtype string

The tax payer subtype of the company.

const (
	SandboxCompanyUpdateResponseEntitySubtypeSCorporation SandboxCompanyUpdateResponseEntitySubtype = "s_corporation"
	SandboxCompanyUpdateResponseEntitySubtypeCCorporation SandboxCompanyUpdateResponseEntitySubtype = "c_corporation"
	SandboxCompanyUpdateResponseEntitySubtypeBCorporation SandboxCompanyUpdateResponseEntitySubtype = "b_corporation"
)

func (SandboxCompanyUpdateResponseEntitySubtype) IsKnown added in v0.16.0

type SandboxCompanyUpdateResponseEntityType added in v0.8.0

type SandboxCompanyUpdateResponseEntityType string

The tax payer type of the company.

const (
	SandboxCompanyUpdateResponseEntityTypeLlc            SandboxCompanyUpdateResponseEntityType = "llc"
	SandboxCompanyUpdateResponseEntityTypeLp             SandboxCompanyUpdateResponseEntityType = "lp"
	SandboxCompanyUpdateResponseEntityTypeCorporation    SandboxCompanyUpdateResponseEntityType = "corporation"
	SandboxCompanyUpdateResponseEntityTypeSoleProprietor SandboxCompanyUpdateResponseEntityType = "sole_proprietor"
	SandboxCompanyUpdateResponseEntityTypeNonProfit      SandboxCompanyUpdateResponseEntityType = "non_profit"
	SandboxCompanyUpdateResponseEntityTypePartnership    SandboxCompanyUpdateResponseEntityType = "partnership"
	SandboxCompanyUpdateResponseEntityTypeCooperative    SandboxCompanyUpdateResponseEntityType = "cooperative"
)

func (SandboxCompanyUpdateResponseEntityType) IsKnown added in v0.16.0

type SandboxConnectionAccountNewParams added in v0.8.0

type SandboxConnectionAccountNewParams struct {
	CompanyID          param.Field[string]                                              `json:"company_id,required" format:"uuid"`
	ProviderID         param.Field[string]                                              `json:"provider_id,required"`
	AuthenticationType param.Field[SandboxConnectionAccountNewParamsAuthenticationType] `json:"authentication_type"`
	// Optional, defaults to Organization products (`company`, `directory`,
	// `employment`, `individual`)
	Products param.Field[[]string] `json:"products"`
}

func (SandboxConnectionAccountNewParams) MarshalJSON added in v0.8.0

func (r SandboxConnectionAccountNewParams) MarshalJSON() (data []byte, err error)

type SandboxConnectionAccountNewParamsAuthenticationType added in v0.8.0

type SandboxConnectionAccountNewParamsAuthenticationType string
const (
	SandboxConnectionAccountNewParamsAuthenticationTypeCredential SandboxConnectionAccountNewParamsAuthenticationType = "credential"
	SandboxConnectionAccountNewParamsAuthenticationTypeAPIToken   SandboxConnectionAccountNewParamsAuthenticationType = "api_token"
	SandboxConnectionAccountNewParamsAuthenticationTypeOAuth      SandboxConnectionAccountNewParamsAuthenticationType = "oauth"
	SandboxConnectionAccountNewParamsAuthenticationTypeAssisted   SandboxConnectionAccountNewParamsAuthenticationType = "assisted"
)

func (SandboxConnectionAccountNewParamsAuthenticationType) IsKnown added in v0.16.0

type SandboxConnectionAccountNewResponse added in v0.8.0

type SandboxConnectionAccountNewResponse struct {
	AccessToken        string                                                `json:"access_token,required" format:"uuid"`
	AccountID          string                                                `json:"account_id,required" format:"uuid"`
	AuthenticationType SandboxConnectionAccountNewResponseAuthenticationType `json:"authentication_type,required"`
	CompanyID          string                                                `json:"company_id,required" format:"uuid"`
	Products           []string                                              `json:"products,required"`
	ProviderID         string                                                `json:"provider_id,required"`
	JSON               sandboxConnectionAccountNewResponseJSON               `json:"-"`
}

func (*SandboxConnectionAccountNewResponse) UnmarshalJSON added in v0.8.0

func (r *SandboxConnectionAccountNewResponse) UnmarshalJSON(data []byte) (err error)

type SandboxConnectionAccountNewResponseAuthenticationType added in v0.8.0

type SandboxConnectionAccountNewResponseAuthenticationType string
const (
	SandboxConnectionAccountNewResponseAuthenticationTypeCredential SandboxConnectionAccountNewResponseAuthenticationType = "credential"
	SandboxConnectionAccountNewResponseAuthenticationTypeAPIToken   SandboxConnectionAccountNewResponseAuthenticationType = "api_token"
	SandboxConnectionAccountNewResponseAuthenticationTypeOAuth      SandboxConnectionAccountNewResponseAuthenticationType = "oauth"
	SandboxConnectionAccountNewResponseAuthenticationTypeAssisted   SandboxConnectionAccountNewResponseAuthenticationType = "assisted"
)

func (SandboxConnectionAccountNewResponseAuthenticationType) IsKnown added in v0.16.0

type SandboxConnectionAccountService added in v0.8.0

type SandboxConnectionAccountService struct {
	Options []option.RequestOption
}

SandboxConnectionAccountService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSandboxConnectionAccountService method instead.

func NewSandboxConnectionAccountService added in v0.8.0

func NewSandboxConnectionAccountService(opts ...option.RequestOption) (r *SandboxConnectionAccountService)

NewSandboxConnectionAccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SandboxConnectionAccountService) New added in v0.8.0

Create a new account for an existing connection (company/provider pair)

func (*SandboxConnectionAccountService) Update added in v0.8.0

Update an existing sandbox account. Change the connection status to understand how the Finch API responds.

type SandboxConnectionAccountUpdateParams added in v0.8.0

type SandboxConnectionAccountUpdateParams struct {
	ConnectionStatus param.Field[shared.ConnectionStatusType] `json:"connection_status"`
}

func (SandboxConnectionAccountUpdateParams) MarshalJSON added in v0.8.0

func (r SandboxConnectionAccountUpdateParams) MarshalJSON() (data []byte, err error)

type SandboxConnectionAccountUpdateResponse added in v0.8.0

type SandboxConnectionAccountUpdateResponse struct {
	AccountID          string                                                   `json:"account_id,required"`
	AuthenticationType SandboxConnectionAccountUpdateResponseAuthenticationType `json:"authentication_type,required"`
	CompanyID          string                                                   `json:"company_id,required" format:"uuid"`
	Products           []string                                                 `json:"products,required"`
	ProviderID         string                                                   `json:"provider_id,required"`
	JSON               sandboxConnectionAccountUpdateResponseJSON               `json:"-"`
}

func (*SandboxConnectionAccountUpdateResponse) UnmarshalJSON added in v0.8.0

func (r *SandboxConnectionAccountUpdateResponse) UnmarshalJSON(data []byte) (err error)

type SandboxConnectionAccountUpdateResponseAuthenticationType added in v0.8.0

type SandboxConnectionAccountUpdateResponseAuthenticationType string
const (
	SandboxConnectionAccountUpdateResponseAuthenticationTypeCredential SandboxConnectionAccountUpdateResponseAuthenticationType = "credential"
	SandboxConnectionAccountUpdateResponseAuthenticationTypeAPIToken   SandboxConnectionAccountUpdateResponseAuthenticationType = "api_token"
	SandboxConnectionAccountUpdateResponseAuthenticationTypeOAuth      SandboxConnectionAccountUpdateResponseAuthenticationType = "oauth"
	SandboxConnectionAccountUpdateResponseAuthenticationTypeAssisted   SandboxConnectionAccountUpdateResponseAuthenticationType = "assisted"
)

func (SandboxConnectionAccountUpdateResponseAuthenticationType) IsKnown added in v0.16.0

type SandboxConnectionNewParams added in v0.8.0

type SandboxConnectionNewParams struct {
	ProviderID         param.Field[string]                                       `json:"provider_id,required"`
	AuthenticationType param.Field[SandboxConnectionNewParamsAuthenticationType] `json:"authentication_type"`
	// Optional: the size of the employer to be created with this connection. Defaults
	// to 20
	EmployeeSize param.Field[int64]    `json:"employee_size"`
	Products     param.Field[[]string] `json:"products"`
}

func (SandboxConnectionNewParams) MarshalJSON added in v0.8.0

func (r SandboxConnectionNewParams) MarshalJSON() (data []byte, err error)

type SandboxConnectionNewParamsAuthenticationType added in v0.8.0

type SandboxConnectionNewParamsAuthenticationType string
const (
	SandboxConnectionNewParamsAuthenticationTypeCredential SandboxConnectionNewParamsAuthenticationType = "credential"
	SandboxConnectionNewParamsAuthenticationTypeAPIToken   SandboxConnectionNewParamsAuthenticationType = "api_token"
	SandboxConnectionNewParamsAuthenticationTypeOAuth      SandboxConnectionNewParamsAuthenticationType = "oauth"
	SandboxConnectionNewParamsAuthenticationTypeAssisted   SandboxConnectionNewParamsAuthenticationType = "assisted"
)

func (SandboxConnectionNewParamsAuthenticationType) IsKnown added in v0.16.0

type SandboxConnectionNewResponse added in v0.8.0

type SandboxConnectionNewResponse struct {
	AccessToken        string                                         `json:"access_token,required" format:"uuid"`
	AccountID          string                                         `json:"account_id,required" format:"uuid"`
	AuthenticationType SandboxConnectionNewResponseAuthenticationType `json:"authentication_type,required"`
	CompanyID          string                                         `json:"company_id,required" format:"uuid"`
	Products           []string                                       `json:"products,required"`
	ProviderID         string                                         `json:"provider_id,required" format:"uuid"`
	JSON               sandboxConnectionNewResponseJSON               `json:"-"`
}

func (*SandboxConnectionNewResponse) UnmarshalJSON added in v0.8.0

func (r *SandboxConnectionNewResponse) UnmarshalJSON(data []byte) (err error)

type SandboxConnectionNewResponseAuthenticationType added in v0.8.0

type SandboxConnectionNewResponseAuthenticationType string
const (
	SandboxConnectionNewResponseAuthenticationTypeCredential SandboxConnectionNewResponseAuthenticationType = "credential"
	SandboxConnectionNewResponseAuthenticationTypeAPIToken   SandboxConnectionNewResponseAuthenticationType = "api_token"
	SandboxConnectionNewResponseAuthenticationTypeOAuth      SandboxConnectionNewResponseAuthenticationType = "oauth"
	SandboxConnectionNewResponseAuthenticationTypeAssisted   SandboxConnectionNewResponseAuthenticationType = "assisted"
)

func (SandboxConnectionNewResponseAuthenticationType) IsKnown added in v0.16.0

type SandboxConnectionService added in v0.8.0

type SandboxConnectionService struct {
	Options  []option.RequestOption
	Accounts *SandboxConnectionAccountService
}

SandboxConnectionService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSandboxConnectionService method instead.

func NewSandboxConnectionService added in v0.8.0

func NewSandboxConnectionService(opts ...option.RequestOption) (r *SandboxConnectionService)

NewSandboxConnectionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SandboxConnectionService) New added in v0.8.0

Create a new connection (new company/provider pair) with a new account

type SandboxDirectoryNewParams added in v0.8.0

type SandboxDirectoryNewParams struct {
	// Array of individuals to create. Takes all combined fields from `/individual` and
	// `/employment` endpoints. All fields are optional.
	Body []SandboxDirectoryNewParamsBody `json:"body,required"`
}

func (SandboxDirectoryNewParams) MarshalJSON added in v0.8.0

func (r SandboxDirectoryNewParams) MarshalJSON() (data []byte, err error)

type SandboxDirectoryNewParamsBody added in v0.8.0

type SandboxDirectoryNewParamsBody struct {
	// Worker's compensation classification code for this employee
	ClassCode param.Field[string] `json:"class_code"`
	// 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.
	CustomFields param.Field[[]SandboxDirectoryNewParamsBodyCustomField] `json:"custom_fields"`
	// The department object.
	Department param.Field[SandboxDirectoryNewParamsBodyDepartment] `json:"department"`
	Dob        param.Field[string]                                  `json:"dob"`
	Emails     param.Field[[]SandboxDirectoryNewParamsBodyEmail]    `json:"emails"`
	// The employment object.
	Employment param.Field[SandboxDirectoryNewParamsBodyEmployment] `json:"employment"`
	// 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.
	EncryptedSsn param.Field[string] `json:"encrypted_ssn"`
	EndDate      param.Field[string] `json:"end_date"`
	// The EEOC-defined ethnicity of the individual.
	Ethnicity param.Field[SandboxDirectoryNewParamsBodyEthnicity] `json:"ethnicity"`
	// The legal first name of the individual.
	FirstName param.Field[string] `json:"first_name"`
	// The gender of the individual.
	Gender param.Field[SandboxDirectoryNewParamsBodyGender] `json:"gender"`
	// 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.
	Income param.Field[IncomeParam] `json:"income"`
	// The array of income history.
	IncomeHistory param.Field[[]IncomeParam] `json:"income_history"`
	// `true` if the individual an an active employee or contractor at the company.
	IsActive param.Field[bool] `json:"is_active"`
	// The legal last name of the individual.
	LastName param.Field[string]        `json:"last_name"`
	Location param.Field[LocationParam] `json:"location"`
	// The manager object representing the manager of the individual within the org.
	Manager param.Field[SandboxDirectoryNewParamsBodyManager] `json:"manager"`
	// The legal middle name of the individual.
	MiddleName   param.Field[string]                                     `json:"middle_name"`
	PhoneNumbers param.Field[[]SandboxDirectoryNewParamsBodyPhoneNumber] `json:"phone_numbers"`
	// The preferred name of the individual.
	PreferredName param.Field[string]        `json:"preferred_name"`
	Residence     param.Field[LocationParam] `json:"residence"`
	// The source system's unique employment identifier for this individual
	SourceID param.Field[string] `json:"source_id"`
	// 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.
	Ssn       param.Field[string] `json:"ssn"`
	StartDate param.Field[string] `json:"start_date"`
	// The current title of the individual.
	Title param.Field[string] `json:"title"`
}

func (SandboxDirectoryNewParamsBody) MarshalJSON added in v0.8.0

func (r SandboxDirectoryNewParamsBody) MarshalJSON() (data []byte, err error)

type SandboxDirectoryNewParamsBodyCustomField added in v0.8.0

type SandboxDirectoryNewParamsBodyCustomField struct {
	Name  param.Field[string]      `json:"name"`
	Value param.Field[interface{}] `json:"value"`
}

func (SandboxDirectoryNewParamsBodyCustomField) MarshalJSON added in v0.8.0

func (r SandboxDirectoryNewParamsBodyCustomField) MarshalJSON() (data []byte, err error)

type SandboxDirectoryNewParamsBodyDepartment added in v0.8.0

type SandboxDirectoryNewParamsBodyDepartment struct {
	// The name of the department associated with the individual.
	Name param.Field[string] `json:"name"`
}

The department object.

func (SandboxDirectoryNewParamsBodyDepartment) MarshalJSON added in v0.8.0

func (r SandboxDirectoryNewParamsBodyDepartment) MarshalJSON() (data []byte, err error)

type SandboxDirectoryNewParamsBodyEmail added in v0.8.0

type SandboxDirectoryNewParamsBodyEmail struct {
	Data param.Field[string]                                  `json:"data"`
	Type param.Field[SandboxDirectoryNewParamsBodyEmailsType] `json:"type"`
}

func (SandboxDirectoryNewParamsBodyEmail) MarshalJSON added in v0.8.0

func (r SandboxDirectoryNewParamsBodyEmail) MarshalJSON() (data []byte, err error)

type SandboxDirectoryNewParamsBodyEmailsType added in v0.8.0

type SandboxDirectoryNewParamsBodyEmailsType string
const (
	SandboxDirectoryNewParamsBodyEmailsTypeWork     SandboxDirectoryNewParamsBodyEmailsType = "work"
	SandboxDirectoryNewParamsBodyEmailsTypePersonal SandboxDirectoryNewParamsBodyEmailsType = "personal"
)

func (SandboxDirectoryNewParamsBodyEmailsType) IsKnown added in v0.16.0

type SandboxDirectoryNewParamsBodyEmployment added in v0.8.0

type SandboxDirectoryNewParamsBodyEmployment struct {
	// The secondary employment type of the individual. Options: `full_time`, `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.
	Subtype param.Field[SandboxDirectoryNewParamsBodyEmploymentSubtype] `json:"subtype"`
	// The main employment type of the individual.
	Type param.Field[SandboxDirectoryNewParamsBodyEmploymentType] `json:"type"`
}

The employment object.

func (SandboxDirectoryNewParamsBodyEmployment) MarshalJSON added in v0.8.0

func (r SandboxDirectoryNewParamsBodyEmployment) MarshalJSON() (data []byte, err error)

type SandboxDirectoryNewParamsBodyEmploymentSubtype added in v0.8.0

type SandboxDirectoryNewParamsBodyEmploymentSubtype string

The secondary employment type of the individual. Options: `full_time`, `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.

const (
	SandboxDirectoryNewParamsBodyEmploymentSubtypeFullTime             SandboxDirectoryNewParamsBodyEmploymentSubtype = "full_time"
	SandboxDirectoryNewParamsBodyEmploymentSubtypeIntern               SandboxDirectoryNewParamsBodyEmploymentSubtype = "intern"
	SandboxDirectoryNewParamsBodyEmploymentSubtypePartTime             SandboxDirectoryNewParamsBodyEmploymentSubtype = "part_time"
	SandboxDirectoryNewParamsBodyEmploymentSubtypeTemp                 SandboxDirectoryNewParamsBodyEmploymentSubtype = "temp"
	SandboxDirectoryNewParamsBodyEmploymentSubtypeSeasonal             SandboxDirectoryNewParamsBodyEmploymentSubtype = "seasonal"
	SandboxDirectoryNewParamsBodyEmploymentSubtypeIndividualContractor SandboxDirectoryNewParamsBodyEmploymentSubtype = "individual_contractor"
)

func (SandboxDirectoryNewParamsBodyEmploymentSubtype) IsKnown added in v0.16.0

type SandboxDirectoryNewParamsBodyEmploymentType added in v0.8.0

type SandboxDirectoryNewParamsBodyEmploymentType string

The main employment type of the individual.

const (
	SandboxDirectoryNewParamsBodyEmploymentTypeEmployee   SandboxDirectoryNewParamsBodyEmploymentType = "employee"
	SandboxDirectoryNewParamsBodyEmploymentTypeContractor SandboxDirectoryNewParamsBodyEmploymentType = "contractor"
)

func (SandboxDirectoryNewParamsBodyEmploymentType) IsKnown added in v0.16.0

type SandboxDirectoryNewParamsBodyEthnicity added in v0.8.0

type SandboxDirectoryNewParamsBodyEthnicity string

The EEOC-defined ethnicity of the individual.

const (
	SandboxDirectoryNewParamsBodyEthnicityAsian                           SandboxDirectoryNewParamsBodyEthnicity = "asian"
	SandboxDirectoryNewParamsBodyEthnicityWhite                           SandboxDirectoryNewParamsBodyEthnicity = "white"
	SandboxDirectoryNewParamsBodyEthnicityBlackOrAfricanAmerican          SandboxDirectoryNewParamsBodyEthnicity = "black_or_african_american"
	SandboxDirectoryNewParamsBodyEthnicityNativeHawaiianOrPacificIslander SandboxDirectoryNewParamsBodyEthnicity = "native_hawaiian_or_pacific_islander"
	SandboxDirectoryNewParamsBodyEthnicityAmericanIndianOrAlaskaNative    SandboxDirectoryNewParamsBodyEthnicity = "american_indian_or_alaska_native"
	SandboxDirectoryNewParamsBodyEthnicityHispanicOrLatino                SandboxDirectoryNewParamsBodyEthnicity = "hispanic_or_latino"
	SandboxDirectoryNewParamsBodyEthnicityTwoOrMoreRaces                  SandboxDirectoryNewParamsBodyEthnicity = "two_or_more_races"
	SandboxDirectoryNewParamsBodyEthnicityDeclineToSpecify                SandboxDirectoryNewParamsBodyEthnicity = "decline_to_specify"
)

func (SandboxDirectoryNewParamsBodyEthnicity) IsKnown added in v0.16.0

type SandboxDirectoryNewParamsBodyGender added in v0.8.0

type SandboxDirectoryNewParamsBodyGender string

The gender of the individual.

const (
	SandboxDirectoryNewParamsBodyGenderFemale           SandboxDirectoryNewParamsBodyGender = "female"
	SandboxDirectoryNewParamsBodyGenderMale             SandboxDirectoryNewParamsBodyGender = "male"
	SandboxDirectoryNewParamsBodyGenderOther            SandboxDirectoryNewParamsBodyGender = "other"
	SandboxDirectoryNewParamsBodyGenderDeclineToSpecify SandboxDirectoryNewParamsBodyGender = "decline_to_specify"
)

func (SandboxDirectoryNewParamsBodyGender) IsKnown added in v0.16.0

type SandboxDirectoryNewParamsBodyManager added in v0.8.0

type SandboxDirectoryNewParamsBodyManager struct {
	// A stable Finch `id` (UUID v4) for an individual in the company.
	ID param.Field[string] `json:"id"`
}

The manager object representing the manager of the individual within the org.

func (SandboxDirectoryNewParamsBodyManager) MarshalJSON added in v0.8.0

func (r SandboxDirectoryNewParamsBodyManager) MarshalJSON() (data []byte, err error)

type SandboxDirectoryNewParamsBodyPhoneNumber added in v0.8.0

type SandboxDirectoryNewParamsBodyPhoneNumber struct {
	Data param.Field[string]                                        `json:"data"`
	Type param.Field[SandboxDirectoryNewParamsBodyPhoneNumbersType] `json:"type"`
}

func (SandboxDirectoryNewParamsBodyPhoneNumber) MarshalJSON added in v0.8.0

func (r SandboxDirectoryNewParamsBodyPhoneNumber) MarshalJSON() (data []byte, err error)

type SandboxDirectoryNewParamsBodyPhoneNumbersType added in v0.8.0

type SandboxDirectoryNewParamsBodyPhoneNumbersType string
const (
	SandboxDirectoryNewParamsBodyPhoneNumbersTypeWork     SandboxDirectoryNewParamsBodyPhoneNumbersType = "work"
	SandboxDirectoryNewParamsBodyPhoneNumbersTypePersonal SandboxDirectoryNewParamsBodyPhoneNumbersType = "personal"
)

func (SandboxDirectoryNewParamsBodyPhoneNumbersType) IsKnown added in v0.16.0

type SandboxDirectoryNewResponse added in v0.8.0

type SandboxDirectoryNewResponse = interface{}

type SandboxDirectoryService added in v0.8.0

type SandboxDirectoryService struct {
	Options []option.RequestOption
}

SandboxDirectoryService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSandboxDirectoryService method instead.

func NewSandboxDirectoryService added in v0.8.0

func NewSandboxDirectoryService(opts ...option.RequestOption) (r *SandboxDirectoryService)

NewSandboxDirectoryService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SandboxDirectoryService) New added in v0.8.0

Add new individuals to a sandbox company

type SandboxEmploymentService added in v0.8.0

type SandboxEmploymentService struct {
	Options []option.RequestOption
}

SandboxEmploymentService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSandboxEmploymentService method instead.

func NewSandboxEmploymentService added in v0.8.0

func NewSandboxEmploymentService(opts ...option.RequestOption) (r *SandboxEmploymentService)

NewSandboxEmploymentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SandboxEmploymentService) Update added in v0.8.0

Update sandbox employment

type SandboxEmploymentUpdateParams added in v0.8.0

type SandboxEmploymentUpdateParams struct {
	// Worker's compensation classification code for this employee
	ClassCode param.Field[string] `json:"class_code"`
	// 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.
	CustomFields param.Field[[]SandboxEmploymentUpdateParamsCustomField] `json:"custom_fields"`
	// The department object.
	Department param.Field[SandboxEmploymentUpdateParamsDepartment] `json:"department"`
	// The employment object.
	Employment param.Field[SandboxEmploymentUpdateParamsEmployment] `json:"employment"`
	EndDate    param.Field[string]                                  `json:"end_date"`
	// The legal first name of the individual.
	FirstName param.Field[string] `json:"first_name"`
	// 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.
	Income param.Field[IncomeParam] `json:"income"`
	// The array of income history.
	IncomeHistory param.Field[[]IncomeParam] `json:"income_history"`
	// `true` if the individual an an active employee or contractor at the company.
	IsActive param.Field[bool] `json:"is_active"`
	// The legal last name of the individual.
	LastName param.Field[string]        `json:"last_name"`
	Location param.Field[LocationParam] `json:"location"`
	// The manager object representing the manager of the individual within the org.
	Manager param.Field[SandboxEmploymentUpdateParamsManager] `json:"manager"`
	// The legal middle name of the individual.
	MiddleName param.Field[string] `json:"middle_name"`
	// The source system's unique employment identifier for this individual
	SourceID  param.Field[string] `json:"source_id"`
	StartDate param.Field[string] `json:"start_date"`
	// The current title of the individual.
	Title param.Field[string] `json:"title"`
}

func (SandboxEmploymentUpdateParams) MarshalJSON added in v0.8.0

func (r SandboxEmploymentUpdateParams) MarshalJSON() (data []byte, err error)

type SandboxEmploymentUpdateParamsCustomField added in v0.8.0

type SandboxEmploymentUpdateParamsCustomField struct {
	Name  param.Field[string]      `json:"name"`
	Value param.Field[interface{}] `json:"value"`
}

func (SandboxEmploymentUpdateParamsCustomField) MarshalJSON added in v0.8.0

func (r SandboxEmploymentUpdateParamsCustomField) MarshalJSON() (data []byte, err error)

type SandboxEmploymentUpdateParamsDepartment added in v0.8.0

type SandboxEmploymentUpdateParamsDepartment struct {
	// The name of the department associated with the individual.
	Name param.Field[string] `json:"name"`
}

The department object.

func (SandboxEmploymentUpdateParamsDepartment) MarshalJSON added in v0.8.0

func (r SandboxEmploymentUpdateParamsDepartment) MarshalJSON() (data []byte, err error)

type SandboxEmploymentUpdateParamsEmployment added in v0.8.0

type SandboxEmploymentUpdateParamsEmployment struct {
	// The secondary employment type of the individual. Options: `full_time`, `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.
	Subtype param.Field[SandboxEmploymentUpdateParamsEmploymentSubtype] `json:"subtype"`
	// The main employment type of the individual.
	Type param.Field[SandboxEmploymentUpdateParamsEmploymentType] `json:"type"`
}

The employment object.

func (SandboxEmploymentUpdateParamsEmployment) MarshalJSON added in v0.8.0

func (r SandboxEmploymentUpdateParamsEmployment) MarshalJSON() (data []byte, err error)

type SandboxEmploymentUpdateParamsEmploymentSubtype added in v0.8.0

type SandboxEmploymentUpdateParamsEmploymentSubtype string

The secondary employment type of the individual. Options: `full_time`, `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.

const (
	SandboxEmploymentUpdateParamsEmploymentSubtypeFullTime             SandboxEmploymentUpdateParamsEmploymentSubtype = "full_time"
	SandboxEmploymentUpdateParamsEmploymentSubtypeIntern               SandboxEmploymentUpdateParamsEmploymentSubtype = "intern"
	SandboxEmploymentUpdateParamsEmploymentSubtypePartTime             SandboxEmploymentUpdateParamsEmploymentSubtype = "part_time"
	SandboxEmploymentUpdateParamsEmploymentSubtypeTemp                 SandboxEmploymentUpdateParamsEmploymentSubtype = "temp"
	SandboxEmploymentUpdateParamsEmploymentSubtypeSeasonal             SandboxEmploymentUpdateParamsEmploymentSubtype = "seasonal"
	SandboxEmploymentUpdateParamsEmploymentSubtypeIndividualContractor SandboxEmploymentUpdateParamsEmploymentSubtype = "individual_contractor"
)

func (SandboxEmploymentUpdateParamsEmploymentSubtype) IsKnown added in v0.16.0

type SandboxEmploymentUpdateParamsEmploymentType added in v0.8.0

type SandboxEmploymentUpdateParamsEmploymentType string

The main employment type of the individual.

const (
	SandboxEmploymentUpdateParamsEmploymentTypeEmployee   SandboxEmploymentUpdateParamsEmploymentType = "employee"
	SandboxEmploymentUpdateParamsEmploymentTypeContractor SandboxEmploymentUpdateParamsEmploymentType = "contractor"
)

func (SandboxEmploymentUpdateParamsEmploymentType) IsKnown added in v0.16.0

type SandboxEmploymentUpdateParamsManager added in v0.8.0

type SandboxEmploymentUpdateParamsManager struct {
	// A stable Finch `id` (UUID v4) for an individual in the company.
	ID param.Field[string] `json:"id"`
}

The manager object representing the manager of the individual within the org.

func (SandboxEmploymentUpdateParamsManager) MarshalJSON added in v0.8.0

func (r SandboxEmploymentUpdateParamsManager) MarshalJSON() (data []byte, err error)

type SandboxEmploymentUpdateResponse added in v0.8.0

type SandboxEmploymentUpdateResponse struct {
	// A stable Finch `id` (UUID v4) for an individual in the company.
	ID string `json:"id"`
	// Worker's compensation classification code for this employee
	ClassCode string `json:"class_code,nullable"`
	// 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.
	CustomFields []SandboxEmploymentUpdateResponseCustomField `json:"custom_fields"`
	// The department object.
	Department SandboxEmploymentUpdateResponseDepartment `json:"department,nullable"`
	// The employment object.
	Employment SandboxEmploymentUpdateResponseEmployment `json:"employment,nullable"`
	EndDate    string                                    `json:"end_date,nullable"`
	// The legal first name of the individual.
	FirstName string `json:"first_name,nullable"`
	// 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.
	Income Income `json:"income,nullable"`
	// The array of income history.
	IncomeHistory []Income `json:"income_history,nullable"`
	// `true` if the individual an an active employee or contractor at the company.
	IsActive bool `json:"is_active,nullable"`
	// The legal last name of the individual.
	LastName string   `json:"last_name,nullable"`
	Location Location `json:"location,nullable"`
	// The manager object representing the manager of the individual within the org.
	Manager SandboxEmploymentUpdateResponseManager `json:"manager,nullable"`
	// The legal middle name of the individual.
	MiddleName string `json:"middle_name,nullable"`
	// The source system's unique employment identifier for this individual
	SourceID  string `json:"source_id"`
	StartDate string `json:"start_date,nullable"`
	// The current title of the individual.
	Title string                              `json:"title,nullable"`
	JSON  sandboxEmploymentUpdateResponseJSON `json:"-"`
}

func (*SandboxEmploymentUpdateResponse) UnmarshalJSON added in v0.8.0

func (r *SandboxEmploymentUpdateResponse) UnmarshalJSON(data []byte) (err error)

type SandboxEmploymentUpdateResponseCustomField added in v0.8.0

type SandboxEmploymentUpdateResponseCustomField struct {
	Name  string                                         `json:"name,nullable"`
	Value interface{}                                    `json:"value"`
	JSON  sandboxEmploymentUpdateResponseCustomFieldJSON `json:"-"`
}

func (*SandboxEmploymentUpdateResponseCustomField) UnmarshalJSON added in v0.8.0

func (r *SandboxEmploymentUpdateResponseCustomField) UnmarshalJSON(data []byte) (err error)

type SandboxEmploymentUpdateResponseDepartment added in v0.8.0

type SandboxEmploymentUpdateResponseDepartment struct {
	// The name of the department associated with the individual.
	Name string                                        `json:"name,nullable"`
	JSON sandboxEmploymentUpdateResponseDepartmentJSON `json:"-"`
}

The department object.

func (*SandboxEmploymentUpdateResponseDepartment) UnmarshalJSON added in v0.8.0

func (r *SandboxEmploymentUpdateResponseDepartment) UnmarshalJSON(data []byte) (err error)

type SandboxEmploymentUpdateResponseEmployment added in v0.8.0

type SandboxEmploymentUpdateResponseEmployment struct {
	// The secondary employment type of the individual. Options: `full_time`, `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.
	Subtype SandboxEmploymentUpdateResponseEmploymentSubtype `json:"subtype,nullable"`
	// The main employment type of the individual.
	Type SandboxEmploymentUpdateResponseEmploymentType `json:"type,nullable"`
	JSON sandboxEmploymentUpdateResponseEmploymentJSON `json:"-"`
}

The employment object.

func (*SandboxEmploymentUpdateResponseEmployment) UnmarshalJSON added in v0.8.0

func (r *SandboxEmploymentUpdateResponseEmployment) UnmarshalJSON(data []byte) (err error)

type SandboxEmploymentUpdateResponseEmploymentSubtype added in v0.8.0

type SandboxEmploymentUpdateResponseEmploymentSubtype string

The secondary employment type of the individual. Options: `full_time`, `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.

const (
	SandboxEmploymentUpdateResponseEmploymentSubtypeFullTime             SandboxEmploymentUpdateResponseEmploymentSubtype = "full_time"
	SandboxEmploymentUpdateResponseEmploymentSubtypeIntern               SandboxEmploymentUpdateResponseEmploymentSubtype = "intern"
	SandboxEmploymentUpdateResponseEmploymentSubtypePartTime             SandboxEmploymentUpdateResponseEmploymentSubtype = "part_time"
	SandboxEmploymentUpdateResponseEmploymentSubtypeTemp                 SandboxEmploymentUpdateResponseEmploymentSubtype = "temp"
	SandboxEmploymentUpdateResponseEmploymentSubtypeSeasonal             SandboxEmploymentUpdateResponseEmploymentSubtype = "seasonal"
	SandboxEmploymentUpdateResponseEmploymentSubtypeIndividualContractor SandboxEmploymentUpdateResponseEmploymentSubtype = "individual_contractor"
)

func (SandboxEmploymentUpdateResponseEmploymentSubtype) IsKnown added in v0.16.0

type SandboxEmploymentUpdateResponseEmploymentType added in v0.8.0

type SandboxEmploymentUpdateResponseEmploymentType string

The main employment type of the individual.

const (
	SandboxEmploymentUpdateResponseEmploymentTypeEmployee   SandboxEmploymentUpdateResponseEmploymentType = "employee"
	SandboxEmploymentUpdateResponseEmploymentTypeContractor SandboxEmploymentUpdateResponseEmploymentType = "contractor"
)

func (SandboxEmploymentUpdateResponseEmploymentType) IsKnown added in v0.16.0

type SandboxEmploymentUpdateResponseManager added in v0.8.0

type SandboxEmploymentUpdateResponseManager struct {
	// A stable Finch `id` (UUID v4) for an individual in the company.
	ID   string                                     `json:"id"`
	JSON sandboxEmploymentUpdateResponseManagerJSON `json:"-"`
}

The manager object representing the manager of the individual within the org.

func (*SandboxEmploymentUpdateResponseManager) UnmarshalJSON added in v0.8.0

func (r *SandboxEmploymentUpdateResponseManager) UnmarshalJSON(data []byte) (err error)

type SandboxIndividualService added in v0.8.0

type SandboxIndividualService struct {
	Options []option.RequestOption
}

SandboxIndividualService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSandboxIndividualService method instead.

func NewSandboxIndividualService added in v0.8.0

func NewSandboxIndividualService(opts ...option.RequestOption) (r *SandboxIndividualService)

NewSandboxIndividualService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SandboxIndividualService) Update added in v0.8.0

Update sandbox individual

type SandboxIndividualUpdateParams added in v0.8.0

type SandboxIndividualUpdateParams struct {
	Dob    param.Field[string]                               `json:"dob"`
	Emails param.Field[[]SandboxIndividualUpdateParamsEmail] `json:"emails"`
	// 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.
	EncryptedSsn param.Field[string] `json:"encrypted_ssn"`
	// The EEOC-defined ethnicity of the individual.
	Ethnicity param.Field[SandboxIndividualUpdateParamsEthnicity] `json:"ethnicity"`
	// The legal first name of the individual.
	FirstName param.Field[string] `json:"first_name"`
	// The gender of the individual.
	Gender param.Field[SandboxIndividualUpdateParamsGender] `json:"gender"`
	// The legal last name of the individual.
	LastName param.Field[string] `json:"last_name"`
	// The legal middle name of the individual.
	MiddleName   param.Field[string]                                     `json:"middle_name"`
	PhoneNumbers param.Field[[]SandboxIndividualUpdateParamsPhoneNumber] `json:"phone_numbers"`
	// The preferred name of the individual.
	PreferredName param.Field[string]        `json:"preferred_name"`
	Residence     param.Field[LocationParam] `json:"residence"`
	// 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.
	Ssn param.Field[string] `json:"ssn"`
}

func (SandboxIndividualUpdateParams) MarshalJSON added in v0.8.0

func (r SandboxIndividualUpdateParams) MarshalJSON() (data []byte, err error)

type SandboxIndividualUpdateParamsEmail added in v0.8.0

type SandboxIndividualUpdateParamsEmail struct {
	Data param.Field[string]                                  `json:"data"`
	Type param.Field[SandboxIndividualUpdateParamsEmailsType] `json:"type"`
}

func (SandboxIndividualUpdateParamsEmail) MarshalJSON added in v0.8.0

func (r SandboxIndividualUpdateParamsEmail) MarshalJSON() (data []byte, err error)

type SandboxIndividualUpdateParamsEmailsType added in v0.8.0

type SandboxIndividualUpdateParamsEmailsType string
const (
	SandboxIndividualUpdateParamsEmailsTypeWork     SandboxIndividualUpdateParamsEmailsType = "work"
	SandboxIndividualUpdateParamsEmailsTypePersonal SandboxIndividualUpdateParamsEmailsType = "personal"
)

func (SandboxIndividualUpdateParamsEmailsType) IsKnown added in v0.16.0

type SandboxIndividualUpdateParamsEthnicity added in v0.8.0

type SandboxIndividualUpdateParamsEthnicity string

The EEOC-defined ethnicity of the individual.

const (
	SandboxIndividualUpdateParamsEthnicityAsian                           SandboxIndividualUpdateParamsEthnicity = "asian"
	SandboxIndividualUpdateParamsEthnicityWhite                           SandboxIndividualUpdateParamsEthnicity = "white"
	SandboxIndividualUpdateParamsEthnicityBlackOrAfricanAmerican          SandboxIndividualUpdateParamsEthnicity = "black_or_african_american"
	SandboxIndividualUpdateParamsEthnicityNativeHawaiianOrPacificIslander SandboxIndividualUpdateParamsEthnicity = "native_hawaiian_or_pacific_islander"
	SandboxIndividualUpdateParamsEthnicityAmericanIndianOrAlaskaNative    SandboxIndividualUpdateParamsEthnicity = "american_indian_or_alaska_native"
	SandboxIndividualUpdateParamsEthnicityHispanicOrLatino                SandboxIndividualUpdateParamsEthnicity = "hispanic_or_latino"
	SandboxIndividualUpdateParamsEthnicityTwoOrMoreRaces                  SandboxIndividualUpdateParamsEthnicity = "two_or_more_races"
	SandboxIndividualUpdateParamsEthnicityDeclineToSpecify                SandboxIndividualUpdateParamsEthnicity = "decline_to_specify"
)

func (SandboxIndividualUpdateParamsEthnicity) IsKnown added in v0.16.0

type SandboxIndividualUpdateParamsGender added in v0.8.0

type SandboxIndividualUpdateParamsGender string

The gender of the individual.

const (
	SandboxIndividualUpdateParamsGenderFemale           SandboxIndividualUpdateParamsGender = "female"
	SandboxIndividualUpdateParamsGenderMale             SandboxIndividualUpdateParamsGender = "male"
	SandboxIndividualUpdateParamsGenderOther            SandboxIndividualUpdateParamsGender = "other"
	SandboxIndividualUpdateParamsGenderDeclineToSpecify SandboxIndividualUpdateParamsGender = "decline_to_specify"
)

func (SandboxIndividualUpdateParamsGender) IsKnown added in v0.16.0

type SandboxIndividualUpdateParamsPhoneNumber added in v0.8.0

type SandboxIndividualUpdateParamsPhoneNumber struct {
	Data param.Field[string]                                        `json:"data"`
	Type param.Field[SandboxIndividualUpdateParamsPhoneNumbersType] `json:"type"`
}

func (SandboxIndividualUpdateParamsPhoneNumber) MarshalJSON added in v0.8.0

func (r SandboxIndividualUpdateParamsPhoneNumber) MarshalJSON() (data []byte, err error)

type SandboxIndividualUpdateParamsPhoneNumbersType added in v0.8.0

type SandboxIndividualUpdateParamsPhoneNumbersType string
const (
	SandboxIndividualUpdateParamsPhoneNumbersTypeWork     SandboxIndividualUpdateParamsPhoneNumbersType = "work"
	SandboxIndividualUpdateParamsPhoneNumbersTypePersonal SandboxIndividualUpdateParamsPhoneNumbersType = "personal"
)

func (SandboxIndividualUpdateParamsPhoneNumbersType) IsKnown added in v0.16.0

type SandboxIndividualUpdateResponse added in v0.8.0

type SandboxIndividualUpdateResponse struct {
	// A stable Finch `id` (UUID v4) for an individual in the company.
	ID     string                                 `json:"id"`
	Dob    string                                 `json:"dob,nullable"`
	Emails []SandboxIndividualUpdateResponseEmail `json:"emails,nullable"`
	// 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.
	EncryptedSsn string `json:"encrypted_ssn,nullable"`
	// The EEOC-defined ethnicity of the individual.
	Ethnicity SandboxIndividualUpdateResponseEthnicity `json:"ethnicity,nullable"`
	// The legal first name of the individual.
	FirstName string `json:"first_name,nullable"`
	// The gender of the individual.
	Gender SandboxIndividualUpdateResponseGender `json:"gender,nullable"`
	// The legal last name of the individual.
	LastName string `json:"last_name,nullable"`
	// The legal middle name of the individual.
	MiddleName   string                                       `json:"middle_name,nullable"`
	PhoneNumbers []SandboxIndividualUpdateResponsePhoneNumber `json:"phone_numbers,nullable"`
	// The preferred name of the individual.
	PreferredName string   `json:"preferred_name,nullable"`
	Residence     Location `json:"residence,nullable"`
	// 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.
	Ssn  string                              `json:"ssn,nullable"`
	JSON sandboxIndividualUpdateResponseJSON `json:"-"`
}

func (*SandboxIndividualUpdateResponse) UnmarshalJSON added in v0.8.0

func (r *SandboxIndividualUpdateResponse) UnmarshalJSON(data []byte) (err error)

type SandboxIndividualUpdateResponseEmail added in v0.8.0

type SandboxIndividualUpdateResponseEmail struct {
	Data string                                    `json:"data"`
	Type SandboxIndividualUpdateResponseEmailsType `json:"type,nullable"`
	JSON sandboxIndividualUpdateResponseEmailJSON  `json:"-"`
}

func (*SandboxIndividualUpdateResponseEmail) UnmarshalJSON added in v0.8.0

func (r *SandboxIndividualUpdateResponseEmail) UnmarshalJSON(data []byte) (err error)

type SandboxIndividualUpdateResponseEmailsType added in v0.8.0

type SandboxIndividualUpdateResponseEmailsType string
const (
	SandboxIndividualUpdateResponseEmailsTypeWork     SandboxIndividualUpdateResponseEmailsType = "work"
	SandboxIndividualUpdateResponseEmailsTypePersonal SandboxIndividualUpdateResponseEmailsType = "personal"
)

func (SandboxIndividualUpdateResponseEmailsType) IsKnown added in v0.16.0

type SandboxIndividualUpdateResponseEthnicity added in v0.8.0

type SandboxIndividualUpdateResponseEthnicity string

The EEOC-defined ethnicity of the individual.

const (
	SandboxIndividualUpdateResponseEthnicityAsian                           SandboxIndividualUpdateResponseEthnicity = "asian"
	SandboxIndividualUpdateResponseEthnicityWhite                           SandboxIndividualUpdateResponseEthnicity = "white"
	SandboxIndividualUpdateResponseEthnicityBlackOrAfricanAmerican          SandboxIndividualUpdateResponseEthnicity = "black_or_african_american"
	SandboxIndividualUpdateResponseEthnicityNativeHawaiianOrPacificIslander SandboxIndividualUpdateResponseEthnicity = "native_hawaiian_or_pacific_islander"
	SandboxIndividualUpdateResponseEthnicityAmericanIndianOrAlaskaNative    SandboxIndividualUpdateResponseEthnicity = "american_indian_or_alaska_native"
	SandboxIndividualUpdateResponseEthnicityHispanicOrLatino                SandboxIndividualUpdateResponseEthnicity = "hispanic_or_latino"
	SandboxIndividualUpdateResponseEthnicityTwoOrMoreRaces                  SandboxIndividualUpdateResponseEthnicity = "two_or_more_races"
	SandboxIndividualUpdateResponseEthnicityDeclineToSpecify                SandboxIndividualUpdateResponseEthnicity = "decline_to_specify"
)

func (SandboxIndividualUpdateResponseEthnicity) IsKnown added in v0.16.0

type SandboxIndividualUpdateResponseGender added in v0.8.0

type SandboxIndividualUpdateResponseGender string

The gender of the individual.

const (
	SandboxIndividualUpdateResponseGenderFemale           SandboxIndividualUpdateResponseGender = "female"
	SandboxIndividualUpdateResponseGenderMale             SandboxIndividualUpdateResponseGender = "male"
	SandboxIndividualUpdateResponseGenderOther            SandboxIndividualUpdateResponseGender = "other"
	SandboxIndividualUpdateResponseGenderDeclineToSpecify SandboxIndividualUpdateResponseGender = "decline_to_specify"
)

func (SandboxIndividualUpdateResponseGender) IsKnown added in v0.16.0

type SandboxIndividualUpdateResponsePhoneNumber added in v0.8.0

type SandboxIndividualUpdateResponsePhoneNumber struct {
	Data string                                          `json:"data"`
	Type SandboxIndividualUpdateResponsePhoneNumbersType `json:"type,nullable"`
	JSON sandboxIndividualUpdateResponsePhoneNumberJSON  `json:"-"`
}

func (*SandboxIndividualUpdateResponsePhoneNumber) UnmarshalJSON added in v0.8.0

func (r *SandboxIndividualUpdateResponsePhoneNumber) UnmarshalJSON(data []byte) (err error)

type SandboxIndividualUpdateResponsePhoneNumbersType added in v0.8.0

type SandboxIndividualUpdateResponsePhoneNumbersType string
const (
	SandboxIndividualUpdateResponsePhoneNumbersTypeWork     SandboxIndividualUpdateResponsePhoneNumbersType = "work"
	SandboxIndividualUpdateResponsePhoneNumbersTypePersonal SandboxIndividualUpdateResponsePhoneNumbersType = "personal"
)

func (SandboxIndividualUpdateResponsePhoneNumbersType) IsKnown added in v0.16.0

type SandboxJobConfiguration added in v0.8.0

type SandboxJobConfiguration struct {
	CompletionStatus SandboxJobConfigurationCompletionStatus `json:"completion_status,required"`
	Type             SandboxJobConfigurationType             `json:"type,required"`
	JSON             sandboxJobConfigurationJSON             `json:"-"`
}

func (*SandboxJobConfiguration) UnmarshalJSON added in v0.8.0

func (r *SandboxJobConfiguration) UnmarshalJSON(data []byte) (err error)

type SandboxJobConfigurationCompletionStatus added in v0.8.0

type SandboxJobConfigurationCompletionStatus string
const (
	SandboxJobConfigurationCompletionStatusComplete         SandboxJobConfigurationCompletionStatus = "complete"
	SandboxJobConfigurationCompletionStatusReauthError      SandboxJobConfigurationCompletionStatus = "reauth_error"
	SandboxJobConfigurationCompletionStatusPermissionsError SandboxJobConfigurationCompletionStatus = "permissions_error"
	SandboxJobConfigurationCompletionStatusError            SandboxJobConfigurationCompletionStatus = "error"
)

func (SandboxJobConfigurationCompletionStatus) IsKnown added in v0.16.0

type SandboxJobConfigurationService added in v0.8.0

type SandboxJobConfigurationService struct {
	Options []option.RequestOption
}

SandboxJobConfigurationService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSandboxJobConfigurationService method instead.

func NewSandboxJobConfigurationService added in v0.8.0

func NewSandboxJobConfigurationService(opts ...option.RequestOption) (r *SandboxJobConfigurationService)

NewSandboxJobConfigurationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SandboxJobConfigurationService) Get added in v0.8.0

Get configurations for sandbox jobs

func (*SandboxJobConfigurationService) Update added in v0.8.0

Update configurations for sandbox jobs

type SandboxJobConfigurationType added in v0.8.0

type SandboxJobConfigurationType string
const (
	SandboxJobConfigurationTypeDataSyncAll SandboxJobConfigurationType = "data_sync_all"
)

func (SandboxJobConfigurationType) IsKnown added in v0.16.0

func (r SandboxJobConfigurationType) IsKnown() bool

type SandboxJobConfigurationUpdateParams added in v0.8.0

type SandboxJobConfigurationUpdateParams struct {
	CompletionStatus param.Field[SandboxJobConfigurationUpdateParamsCompletionStatus] `json:"completion_status,required"`
	Type             param.Field[SandboxJobConfigurationUpdateParamsType]             `json:"type,required"`
}

func (SandboxJobConfigurationUpdateParams) MarshalJSON added in v0.8.0

func (r SandboxJobConfigurationUpdateParams) MarshalJSON() (data []byte, err error)

type SandboxJobConfigurationUpdateParamsCompletionStatus added in v0.8.0

type SandboxJobConfigurationUpdateParamsCompletionStatus string
const (
	SandboxJobConfigurationUpdateParamsCompletionStatusComplete         SandboxJobConfigurationUpdateParamsCompletionStatus = "complete"
	SandboxJobConfigurationUpdateParamsCompletionStatusReauthError      SandboxJobConfigurationUpdateParamsCompletionStatus = "reauth_error"
	SandboxJobConfigurationUpdateParamsCompletionStatusPermissionsError SandboxJobConfigurationUpdateParamsCompletionStatus = "permissions_error"
	SandboxJobConfigurationUpdateParamsCompletionStatusError            SandboxJobConfigurationUpdateParamsCompletionStatus = "error"
)

func (SandboxJobConfigurationUpdateParamsCompletionStatus) IsKnown added in v0.16.0

type SandboxJobConfigurationUpdateParamsType added in v0.8.0

type SandboxJobConfigurationUpdateParamsType string
const (
	SandboxJobConfigurationUpdateParamsTypeDataSyncAll SandboxJobConfigurationUpdateParamsType = "data_sync_all"
)

func (SandboxJobConfigurationUpdateParamsType) IsKnown added in v0.16.0

type SandboxJobNewParams added in v0.12.0

type SandboxJobNewParams struct {
	// The type of job to start. Currently the only supported type is `data_sync_all`
	Type param.Field[SandboxJobNewParamsType] `json:"type,required"`
}

func (SandboxJobNewParams) MarshalJSON added in v0.12.0

func (r SandboxJobNewParams) MarshalJSON() (data []byte, err error)

type SandboxJobNewParamsType added in v0.12.0

type SandboxJobNewParamsType string

The type of job to start. Currently the only supported type is `data_sync_all`

const (
	SandboxJobNewParamsTypeDataSyncAll SandboxJobNewParamsType = "data_sync_all"
)

func (SandboxJobNewParamsType) IsKnown added in v0.16.0

func (r SandboxJobNewParamsType) IsKnown() bool

type SandboxJobNewResponse added in v0.12.0

type SandboxJobNewResponse struct {
	// The number of allowed refreshes per hour (per hour, fixed window)
	AllowedRefreshes int64 `json:"allowed_refreshes,required"`
	// The id of the job that has been created.
	JobID string `json:"job_id,required" format:"uuid"`
	// The url that can be used to retrieve the job status
	JobURL string `json:"job_url,required"`
	// The number of remaining refreshes available (per hour, fixed window)
	RemainingRefreshes int64                     `json:"remaining_refreshes,required"`
	JSON               sandboxJobNewResponseJSON `json:"-"`
}

func (*SandboxJobNewResponse) UnmarshalJSON added in v0.12.0

func (r *SandboxJobNewResponse) UnmarshalJSON(data []byte) (err error)

type SandboxJobService added in v0.8.0

type SandboxJobService struct {
	Options       []option.RequestOption
	Configuration *SandboxJobConfigurationService
}

SandboxJobService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSandboxJobService method instead.

func NewSandboxJobService added in v0.8.0

func NewSandboxJobService(opts ...option.RequestOption) (r *SandboxJobService)

NewSandboxJobService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SandboxJobService) New added in v0.12.0

Enqueue a new sandbox job

type SandboxPaymentNewParams added in v0.8.0

type SandboxPaymentNewParams struct {
	EndDate       param.Field[string]                                `json:"end_date"`
	PayStatements param.Field[[]SandboxPaymentNewParamsPayStatement] `json:"pay_statements"`
	StartDate     param.Field[string]                                `json:"start_date"`
}

func (SandboxPaymentNewParams) MarshalJSON added in v0.8.0

func (r SandboxPaymentNewParams) MarshalJSON() (data []byte, err error)

type SandboxPaymentNewParamsPayStatement added in v0.8.0

type SandboxPaymentNewParamsPayStatement struct {
	// The array of earnings objects associated with this pay statement
	Earnings param.Field[[]SandboxPaymentNewParamsPayStatementsEarning] `json:"earnings"`
	// The array of deductions objects associated with this pay statement.
	EmployeeDeductions    param.Field[[]SandboxPaymentNewParamsPayStatementsEmployeeDeduction]    `json:"employee_deductions"`
	EmployerContributions param.Field[[]SandboxPaymentNewParamsPayStatementsEmployerContribution] `json:"employer_contributions"`
	GrossPay              param.Field[MoneyParam]                                                 `json:"gross_pay"`
	// A stable Finch `id` (UUID v4) for an individual in the company
	IndividualID param.Field[string]     `json:"individual_id"`
	NetPay       param.Field[MoneyParam] `json:"net_pay"`
	// The payment method.
	PaymentMethod param.Field[SandboxPaymentNewParamsPayStatementsPaymentMethod] `json:"payment_method"`
	// The array of taxes objects associated with this pay statement.
	Taxes param.Field[[]SandboxPaymentNewParamsPayStatementsTax] `json:"taxes"`
	// The number of hours worked for this pay period
	TotalHours param.Field[float64] `json:"total_hours"`
	// The type of the payment associated with the pay statement.
	Type param.Field[SandboxPaymentNewParamsPayStatementsType] `json:"type"`
}

func (SandboxPaymentNewParamsPayStatement) MarshalJSON added in v0.8.0

func (r SandboxPaymentNewParamsPayStatement) MarshalJSON() (data []byte, err error)

type SandboxPaymentNewParamsPayStatementsEarning added in v0.8.0

type SandboxPaymentNewParamsPayStatementsEarning struct {
	// The earnings amount in cents.
	Amount param.Field[int64] `json:"amount"`
	// The earnings currency code.
	Currency param.Field[string] `json:"currency"`
	// The number of hours associated with this earning. (For salaried employees, this
	// could be hours per pay period, `0` or `null`, depending on the provider).
	Hours param.Field[float64] `json:"hours"`
	// The exact name of the deduction from the pay statement.
	Name param.Field[string] `json:"name"`
	// The type of earning.
	Type param.Field[SandboxPaymentNewParamsPayStatementsEarningsType] `json:"type"`
}

func (SandboxPaymentNewParamsPayStatementsEarning) MarshalJSON added in v0.8.0

func (r SandboxPaymentNewParamsPayStatementsEarning) MarshalJSON() (data []byte, err error)

type SandboxPaymentNewParamsPayStatementsEarningsType added in v0.8.0

type SandboxPaymentNewParamsPayStatementsEarningsType string

The type of earning.

const (
	SandboxPaymentNewParamsPayStatementsEarningsTypeSalary         SandboxPaymentNewParamsPayStatementsEarningsType = "salary"
	SandboxPaymentNewParamsPayStatementsEarningsTypeWage           SandboxPaymentNewParamsPayStatementsEarningsType = "wage"
	SandboxPaymentNewParamsPayStatementsEarningsTypeReimbursement  SandboxPaymentNewParamsPayStatementsEarningsType = "reimbursement"
	SandboxPaymentNewParamsPayStatementsEarningsTypeOvertime       SandboxPaymentNewParamsPayStatementsEarningsType = "overtime"
	SandboxPaymentNewParamsPayStatementsEarningsTypeSeverance      SandboxPaymentNewParamsPayStatementsEarningsType = "severance"
	SandboxPaymentNewParamsPayStatementsEarningsTypeDoubleOvertime SandboxPaymentNewParamsPayStatementsEarningsType = "double_overtime"
	SandboxPaymentNewParamsPayStatementsEarningsTypePto            SandboxPaymentNewParamsPayStatementsEarningsType = "pto"
	SandboxPaymentNewParamsPayStatementsEarningsTypeSick           SandboxPaymentNewParamsPayStatementsEarningsType = "sick"
	SandboxPaymentNewParamsPayStatementsEarningsTypeBonus          SandboxPaymentNewParamsPayStatementsEarningsType = "bonus"
	SandboxPaymentNewParamsPayStatementsEarningsTypeCommission     SandboxPaymentNewParamsPayStatementsEarningsType = "commission"
	SandboxPaymentNewParamsPayStatementsEarningsTypeTips           SandboxPaymentNewParamsPayStatementsEarningsType = "tips"
	SandboxPaymentNewParamsPayStatementsEarningsType1099           SandboxPaymentNewParamsPayStatementsEarningsType = "1099"
	SandboxPaymentNewParamsPayStatementsEarningsTypeOther          SandboxPaymentNewParamsPayStatementsEarningsType = "other"
)

func (SandboxPaymentNewParamsPayStatementsEarningsType) IsKnown added in v0.16.0

type SandboxPaymentNewParamsPayStatementsEmployeeDeduction added in v0.8.0

type SandboxPaymentNewParamsPayStatementsEmployeeDeduction struct {
	// The deduction amount in cents.
	Amount param.Field[int64] `json:"amount"`
	// The deduction currency.
	Currency param.Field[string] `json:"currency"`
	// The deduction name from the pay statement.
	Name param.Field[string] `json:"name"`
	// Boolean indicating if the deduction is pre-tax.
	PreTax param.Field[bool] `json:"pre_tax"`
	// Type of benefit.
	Type param.Field[BenefitType] `json:"type"`
}

func (SandboxPaymentNewParamsPayStatementsEmployeeDeduction) MarshalJSON added in v0.8.0

type SandboxPaymentNewParamsPayStatementsEmployerContribution added in v0.8.0

type SandboxPaymentNewParamsPayStatementsEmployerContribution struct {
	// The contribution amount in cents.
	Amount param.Field[int64] `json:"amount"`
	// The contribution currency.
	Currency param.Field[string] `json:"currency"`
	// The contribution name from the pay statement.
	Name param.Field[string] `json:"name"`
	// Type of benefit.
	Type param.Field[BenefitType] `json:"type"`
}

func (SandboxPaymentNewParamsPayStatementsEmployerContribution) MarshalJSON added in v0.8.0

type SandboxPaymentNewParamsPayStatementsPaymentMethod added in v0.8.0

type SandboxPaymentNewParamsPayStatementsPaymentMethod string

The payment method.

const (
	SandboxPaymentNewParamsPayStatementsPaymentMethodCheck         SandboxPaymentNewParamsPayStatementsPaymentMethod = "check"
	SandboxPaymentNewParamsPayStatementsPaymentMethodDirectDeposit SandboxPaymentNewParamsPayStatementsPaymentMethod = "direct_deposit"
)

func (SandboxPaymentNewParamsPayStatementsPaymentMethod) IsKnown added in v0.16.0

type SandboxPaymentNewParamsPayStatementsTax added in v0.8.0

type SandboxPaymentNewParamsPayStatementsTax struct {
	// The tax amount in cents.
	Amount param.Field[int64] `json:"amount"`
	// The currency code.
	Currency param.Field[string] `json:"currency"`
	// `true` if the amount is paid by the employers.
	Employer param.Field[bool] `json:"employer"`
	// The exact name of tax from the pay statement.
	Name param.Field[string] `json:"name"`
	// The type of taxes.
	Type param.Field[SandboxPaymentNewParamsPayStatementsTaxesType] `json:"type"`
}

func (SandboxPaymentNewParamsPayStatementsTax) MarshalJSON added in v0.8.0

func (r SandboxPaymentNewParamsPayStatementsTax) MarshalJSON() (data []byte, err error)

type SandboxPaymentNewParamsPayStatementsTaxesType added in v0.8.0

type SandboxPaymentNewParamsPayStatementsTaxesType string

The type of taxes.

const (
	SandboxPaymentNewParamsPayStatementsTaxesTypeState   SandboxPaymentNewParamsPayStatementsTaxesType = "state"
	SandboxPaymentNewParamsPayStatementsTaxesTypeFederal SandboxPaymentNewParamsPayStatementsTaxesType = "federal"
	SandboxPaymentNewParamsPayStatementsTaxesTypeLocal   SandboxPaymentNewParamsPayStatementsTaxesType = "local"
	SandboxPaymentNewParamsPayStatementsTaxesTypeFica    SandboxPaymentNewParamsPayStatementsTaxesType = "fica"
)

func (SandboxPaymentNewParamsPayStatementsTaxesType) IsKnown added in v0.16.0

type SandboxPaymentNewParamsPayStatementsType added in v0.8.0

type SandboxPaymentNewParamsPayStatementsType string

The type of the payment associated with the pay statement.

const (
	SandboxPaymentNewParamsPayStatementsTypeRegularPayroll  SandboxPaymentNewParamsPayStatementsType = "regular_payroll"
	SandboxPaymentNewParamsPayStatementsTypeOffCyclePayroll SandboxPaymentNewParamsPayStatementsType = "off_cycle_payroll"
	SandboxPaymentNewParamsPayStatementsTypeOneTimePayment  SandboxPaymentNewParamsPayStatementsType = "one_time_payment"
)

func (SandboxPaymentNewParamsPayStatementsType) IsKnown added in v0.16.0

type SandboxPaymentNewResponse added in v0.8.0

type SandboxPaymentNewResponse struct {
	// The date of the payment.
	PayDate string `json:"pay_date,required"`
	// The ID of the payment.
	PaymentID string                        `json:"payment_id,required"`
	JSON      sandboxPaymentNewResponseJSON `json:"-"`
}

func (*SandboxPaymentNewResponse) UnmarshalJSON added in v0.8.0

func (r *SandboxPaymentNewResponse) UnmarshalJSON(data []byte) (err error)

type SandboxPaymentService added in v0.8.0

type SandboxPaymentService struct {
	Options []option.RequestOption
}

SandboxPaymentService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSandboxPaymentService method instead.

func NewSandboxPaymentService added in v0.8.0

func NewSandboxPaymentService(opts ...option.RequestOption) (r *SandboxPaymentService)

NewSandboxPaymentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SandboxPaymentService) New added in v0.8.0

Add a new sandbox payment

type SandboxService added in v0.8.0

type SandboxService struct {
	Options     []option.RequestOption
	Connections *SandboxConnectionService
	Company     *SandboxCompanyService
	Directory   *SandboxDirectoryService
	Individual  *SandboxIndividualService
	Employment  *SandboxEmploymentService
	Payment     *SandboxPaymentService
	Jobs        *SandboxJobService
}

SandboxService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSandboxService method instead.

func NewSandboxService added in v0.8.0

func NewSandboxService(opts ...option.RequestOption) (r *SandboxService)

NewSandboxService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type SupportPerBenefitType added in v0.5.0

type SupportPerBenefitType struct {
	CompanyBenefits    shared.OperationSupportMatrix `json:"company_benefits"`
	IndividualBenefits shared.OperationSupportMatrix `json:"individual_benefits"`
	JSON               supportPerBenefitTypeJSON     `json:"-"`
}

func (*SupportPerBenefitType) UnmarshalJSON added in v0.5.0

func (r *SupportPerBenefitType) UnmarshalJSON(data []byte) (err error)

type SupportedBenefit

type SupportedBenefit struct {
	// Whether the provider supports an annual maximum for this benefit.
	AnnualMaximum bool `json:"annual_maximum,nullable"`
	// Whether the provider supports catch up for this benefit. This field will only be
	// true for retirement benefits.
	CatchUp bool `json:"catch_up,nullable"`
	// Supported contribution types. An empty array indicates contributions are not
	// supported.
	CompanyContribution []SupportedBenefitCompanyContribution `json:"company_contribution,nullable"`
	Description         string                                `json:"description,nullable"`
	// Supported deduction types. An empty array indicates deductions are not
	// supported.
	EmployeeDeduction []SupportedBenefitEmployeeDeduction `json:"employee_deduction,nullable"`
	// The list of frequencies supported by the provider for this benefit
	Frequencies []BenefitFrequency `json:"frequencies"`
	// Whether the provider supports HSA contribution limits. Empty if this feature is
	// not supported for the benefit. This array only has values for HSA benefits.
	HsaContributionLimit []SupportedBenefitHsaContributionLimit `json:"hsa_contribution_limit,nullable"`
	// Type of benefit.
	Type BenefitType          `json:"type,nullable"`
	JSON supportedBenefitJSON `json:"-"`
}

func (*SupportedBenefit) UnmarshalJSON

func (r *SupportedBenefit) UnmarshalJSON(data []byte) (err error)

type SupportedBenefitCompanyContribution

type SupportedBenefitCompanyContribution string
const (
	SupportedBenefitCompanyContributionFixed   SupportedBenefitCompanyContribution = "fixed"
	SupportedBenefitCompanyContributionPercent SupportedBenefitCompanyContribution = "percent"
)

func (SupportedBenefitCompanyContribution) IsKnown added in v0.16.0

type SupportedBenefitEmployeeDeduction

type SupportedBenefitEmployeeDeduction string
const (
	SupportedBenefitEmployeeDeductionFixed   SupportedBenefitEmployeeDeduction = "fixed"
	SupportedBenefitEmployeeDeductionPercent SupportedBenefitEmployeeDeduction = "percent"
)

func (SupportedBenefitEmployeeDeduction) IsKnown added in v0.16.0

type SupportedBenefitHsaContributionLimit

type SupportedBenefitHsaContributionLimit string
const (
	SupportedBenefitHsaContributionLimitIndividual SupportedBenefitHsaContributionLimit = "individual"
	SupportedBenefitHsaContributionLimitFamily     SupportedBenefitHsaContributionLimit = "family"
)

func (SupportedBenefitHsaContributionLimit) IsKnown added in v0.16.0

type UnenrolledIndividual

type UnenrolledIndividual struct {
	Body UnenrolledIndividualBody `json:"body"`
	// HTTP status code
	Code         int64                    `json:"code"`
	IndividualID string                   `json:"individual_id"`
	JSON         unenrolledIndividualJSON `json:"-"`
}

func (*UnenrolledIndividual) UnmarshalJSON

func (r *UnenrolledIndividual) UnmarshalJSON(data []byte) (err error)

type UnenrolledIndividualBody

type UnenrolledIndividualBody struct {
	// A descriptive identifier for the response.
	FinchCode string `json:"finch_code,nullable"`
	// Short description in English that provides more information about the response.
	Message string `json:"message,nullable"`
	// Identifier indicating whether the benefit was newly enrolled or updated.
	Name string                       `json:"name,nullable"`
	JSON unenrolledIndividualBodyJSON `json:"-"`
}

func (*UnenrolledIndividualBody) UnmarshalJSON

func (r *UnenrolledIndividualBody) UnmarshalJSON(data []byte) (err error)

type UpdateCompanyBenefitResponse

type UpdateCompanyBenefitResponse struct {
	BenefitID string                           `json:"benefit_id,required"`
	JSON      updateCompanyBenefitResponseJSON `json:"-"`
}

func (*UpdateCompanyBenefitResponse) UnmarshalJSON

func (r *UpdateCompanyBenefitResponse) UnmarshalJSON(data []byte) (err error)

type WebhookEventUnion added in v0.17.0

type WebhookEventUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by AccountUpdateEvent, JobCompletionEvent, CompanyEvent, DirectoryEvent, EmploymentEvent, IndividualEvent, PaymentEvent or PayStatementEvent.

type WebhookService

type WebhookService struct {
	Options []option.RequestOption
}

WebhookService contains methods and other services that help with interacting with the Finch API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.

func NewWebhookService

func NewWebhookService(opts ...option.RequestOption) (r *WebhookService)

NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*WebhookService) Unwrap added in v0.10.0

func (r *WebhookService) Unwrap(payload []byte, headers http.Header, secret string, now time.Time) (res WebhookEventUnion, err error)

Validates that the given payload was sent by Finch and parses the payload.

func (*WebhookService) VerifySignature

func (r *WebhookService) VerifySignature(payload []byte, headers http.Header, secret string, now time.Time) (err error)

Validates whether or not the webhook payload was sent by Finch.

An error will be raised if the webhook payload was not sent by Finch.

type WebhookUnwrapParams added in v0.10.0

type WebhookUnwrapParams struct {
}

type WebhookVerifySignatureParams

type WebhookVerifySignatureParams struct {
}

type WithAccessTokenParams added in v0.8.0

type WithAccessTokenParams struct {
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL