diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 06d6df2..b7634f9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.2" + ".": "1.0.3" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e04a04b..921b751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.0.3 (2024-08-12) + +Full Changelog: [v1.0.2...v1.0.3](https://github.com/Finch-API/finch-api-go/compare/v1.0.2...v1.0.3) + +### Chores + +* **examples:** minor formatting changes ([#231](https://github.com/Finch-API/finch-api-go/issues/231)) ([392ef1c](https://github.com/Finch-API/finch-api-go/commit/392ef1ca32a02aebd0fcc7faf0bdca23ad36525f)) + ## 1.0.2 (2024-08-12) Full Changelog: [v1.0.1...v1.0.2](https://github.com/Finch-API/finch-api-go/compare/v1.0.1...v1.0.2) diff --git a/README.md b/README.md index b35c0be..4e9907c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Or to pin the version: ```sh -go get -u 'github.com/Finch-API/finch-api-go@v1.0.2' +go get -u 'github.com/Finch-API/finch-api-go@v1.0.3' ``` diff --git a/internal/version.go b/internal/version.go index e6ff8ab..2ac60d6 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "1.0.2" // x-release-please-version +const PackageVersion = "1.0.3" // x-release-please-version diff --git a/sandboxcompany_test.go b/sandboxcompany_test.go index 6e24ace..5f7f30f 100644 --- a/sandboxcompany_test.go +++ b/sandboxcompany_test.go @@ -29,23 +29,23 @@ func TestSandboxCompanyUpdateWithOptionalParams(t *testing.T) { ) _, err := client.Sandbox.Company.Update(context.TODO(), finchgo.SandboxCompanyUpdateParams{ Accounts: finchgo.F([]finchgo.SandboxCompanyUpdateParamsAccount{{ - RoutingNumber: finchgo.F("routing_number"), AccountName: finchgo.F("account_name"), - InstitutionName: finchgo.F("institution_name"), - AccountType: finchgo.F(finchgo.SandboxCompanyUpdateParamsAccountsAccountTypeChecking), AccountNumber: finchgo.F("account_number"), - }, { + AccountType: finchgo.F(finchgo.SandboxCompanyUpdateParamsAccountsAccountTypeChecking), + InstitutionName: finchgo.F("institution_name"), RoutingNumber: finchgo.F("routing_number"), + }, { AccountName: finchgo.F("account_name"), - InstitutionName: finchgo.F("institution_name"), - AccountType: finchgo.F(finchgo.SandboxCompanyUpdateParamsAccountsAccountTypeChecking), AccountNumber: finchgo.F("account_number"), - }, { + AccountType: finchgo.F(finchgo.SandboxCompanyUpdateParamsAccountsAccountTypeChecking), + InstitutionName: finchgo.F("institution_name"), RoutingNumber: finchgo.F("routing_number"), + }, { AccountName: finchgo.F("account_name"), - InstitutionName: finchgo.F("institution_name"), - AccountType: finchgo.F(finchgo.SandboxCompanyUpdateParamsAccountsAccountTypeChecking), AccountNumber: finchgo.F("account_number"), + AccountType: finchgo.F(finchgo.SandboxCompanyUpdateParamsAccountsAccountTypeChecking), + InstitutionName: finchgo.F("institution_name"), + RoutingNumber: finchgo.F("routing_number"), }}), Departments: finchgo.F([]finchgo.SandboxCompanyUpdateParamsDepartment{{ Name: finchgo.F("name"), @@ -65,37 +65,37 @@ func TestSandboxCompanyUpdateWithOptionalParams(t *testing.T) { }}), Ein: finchgo.F("ein"), Entity: finchgo.F(finchgo.SandboxCompanyUpdateParamsEntity{ - Type: finchgo.F(finchgo.SandboxCompanyUpdateParamsEntityTypeLlc), Subtype: finchgo.F(finchgo.SandboxCompanyUpdateParamsEntitySubtypeSCorporation), + Type: finchgo.F(finchgo.SandboxCompanyUpdateParamsEntityTypeLlc), }), LegalName: finchgo.F("legal_name"), Locations: finchgo.F([]finchgo.LocationParam{{ - Line1: finchgo.F("line1"), - Line2: finchgo.F("line2"), City: finchgo.F("city"), - State: finchgo.F("state"), - PostalCode: finchgo.F("postal_code"), Country: finchgo.F("country"), + Line1: finchgo.F("line1"), + Line2: finchgo.F("line2"), Name: finchgo.F("name"), + PostalCode: finchgo.F("postal_code"), SourceID: finchgo.F("source_id"), + State: finchgo.F("state"), }, { - Line1: finchgo.F("line1"), - Line2: finchgo.F("line2"), City: finchgo.F("city"), - State: finchgo.F("state"), - PostalCode: finchgo.F("postal_code"), Country: finchgo.F("country"), + Line1: finchgo.F("line1"), + Line2: finchgo.F("line2"), Name: finchgo.F("name"), + PostalCode: finchgo.F("postal_code"), SourceID: finchgo.F("source_id"), + State: finchgo.F("state"), }, { - Line1: finchgo.F("line1"), - Line2: finchgo.F("line2"), City: finchgo.F("city"), - State: finchgo.F("state"), - PostalCode: finchgo.F("postal_code"), Country: finchgo.F("country"), + Line1: finchgo.F("line1"), + Line2: finchgo.F("line2"), Name: finchgo.F("name"), + PostalCode: finchgo.F("postal_code"), SourceID: finchgo.F("source_id"), + State: finchgo.F("state"), }}), PrimaryEmail: finchgo.F("primary_email"), PrimaryPhoneNumber: finchgo.F("primary_phone_number"), diff --git a/sandboxconnectionaccount_test.go b/sandboxconnectionaccount_test.go index 435cc6a..9f5eb66 100644 --- a/sandboxconnectionaccount_test.go +++ b/sandboxconnectionaccount_test.go @@ -59,7 +59,7 @@ func TestSandboxConnectionAccountUpdateWithOptionalParams(t *testing.T) { option.WithClientSecret("My Client Secret"), ) _, err := client.Sandbox.Connections.Accounts.Update(context.TODO(), finchgo.SandboxConnectionAccountUpdateParams{ - ConnectionStatus: finchgo.F(shared.ConnectionStatusTypeReauth), + ConnectionStatus: finchgo.F(shared.ConnectionStatusTypePending), }) if err != nil { var apierr *finchgo.Error diff --git a/sandboxdirectory_test.go b/sandboxdirectory_test.go index 74c6a51..642554e 100644 --- a/sandboxdirectory_test.go +++ b/sandboxdirectory_test.go @@ -29,10 +29,21 @@ func TestSandboxDirectoryNew(t *testing.T) { ) _, err := client.Sandbox.Directory.New(context.TODO(), finchgo.SandboxDirectoryNewParams{ Body: []finchgo.SandboxDirectoryNewParamsBody{{ - FirstName: finchgo.F("John"), - MiddleName: finchgo.F("middle_name"), - LastName: finchgo.F("Smith"), - PreferredName: finchgo.F("preferred_name"), + ClassCode: finchgo.F("class_code"), + CustomFields: finchgo.F([]finchgo.SandboxDirectoryNewParamsBodyCustomField{{ + Name: finchgo.F("name"), + Value: finchgo.F[any](map[string]interface{}{}), + }, { + Name: finchgo.F("name"), + Value: finchgo.F[any](map[string]interface{}{}), + }, { + Name: finchgo.F("name"), + Value: finchgo.F[any](map[string]interface{}{}), + }}), + Department: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyDepartment{ + Name: finchgo.F("name"), + }), + Dob: finchgo.F("01/01/2000"), Emails: finchgo.F([]finchgo.SandboxDirectoryNewParamsBodyEmail{{ Data: finchgo.F("data"), Type: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyEmailsTypeWork), @@ -43,89 +54,78 @@ func TestSandboxDirectoryNew(t *testing.T) { Data: finchgo.F("data"), Type: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyEmailsTypeWork), }}), - PhoneNumbers: finchgo.F([]finchgo.SandboxDirectoryNewParamsBodyPhoneNumber{{ - Data: finchgo.F("data"), - Type: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyPhoneNumbersTypeWork), - }, { - Data: finchgo.F("data"), - Type: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyPhoneNumbersTypeWork), - }, { - Data: finchgo.F("data"), - Type: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyPhoneNumbersTypeWork), - }}), - Gender: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyGenderFemale), - Ethnicity: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyEthnicityAsian), - Dob: finchgo.F("01/01/2000"), - Ssn: finchgo.F("ssn"), - EncryptedSsn: finchgo.F("encrypted_ssn"), - Residence: finchgo.F(finchgo.LocationParam{ - Line1: finchgo.F("line1"), - Line2: finchgo.F("line2"), - City: finchgo.F("city"), - State: finchgo.F("state"), - PostalCode: finchgo.F("postal_code"), - Country: finchgo.F("country"), - Name: finchgo.F("name"), - SourceID: finchgo.F("source_id"), - }), - Title: finchgo.F("title"), - Manager: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyManager{ - ID: finchgo.F("id"), - }), - Department: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyDepartment{ - Name: finchgo.F("name"), - }), Employment: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyEmployment{ - Type: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyEmploymentTypeEmployee), Subtype: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyEmploymentSubtypeFullTime), + Type: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyEmploymentTypeEmployee), }), - StartDate: finchgo.F("start_date"), - EndDate: finchgo.F("end_date"), - IsActive: finchgo.F(true), - ClassCode: finchgo.F("class_code"), - Location: finchgo.F(finchgo.LocationParam{ - Line1: finchgo.F("line1"), - Line2: finchgo.F("line2"), - City: finchgo.F("city"), - State: finchgo.F("state"), - PostalCode: finchgo.F("postal_code"), - Country: finchgo.F("country"), - Name: finchgo.F("name"), - SourceID: finchgo.F("source_id"), - }), + EncryptedSsn: finchgo.F("encrypted_ssn"), + EndDate: finchgo.F("end_date"), + Ethnicity: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyEthnicityAsian), + FirstName: finchgo.F("John"), + Gender: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyGenderFemale), Income: finchgo.F(finchgo.IncomeParam{ - Unit: finchgo.F(finchgo.IncomeUnitYearly), Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), EffectiveDate: finchgo.F("effective_date"), + Unit: finchgo.F(finchgo.IncomeUnitYearly), }), IncomeHistory: finchgo.F([]finchgo.IncomeParam{{ - Unit: finchgo.F(finchgo.IncomeUnitYearly), Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), EffectiveDate: finchgo.F("effective_date"), - }, { Unit: finchgo.F(finchgo.IncomeUnitYearly), + }, { Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), EffectiveDate: finchgo.F("effective_date"), - }, { Unit: finchgo.F(finchgo.IncomeUnitYearly), + }, { Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), EffectiveDate: finchgo.F("effective_date"), + Unit: finchgo.F(finchgo.IncomeUnitYearly), }}), - CustomFields: finchgo.F([]finchgo.SandboxDirectoryNewParamsBodyCustomField{{ - Name: finchgo.F("name"), - Value: finchgo.F[any](map[string]interface{}{}), + IsActive: finchgo.F(true), + LastName: finchgo.F("Smith"), + Location: finchgo.F(finchgo.LocationParam{ + City: finchgo.F("city"), + Country: finchgo.F("country"), + Line1: finchgo.F("line1"), + Line2: finchgo.F("line2"), + Name: finchgo.F("name"), + PostalCode: finchgo.F("postal_code"), + SourceID: finchgo.F("source_id"), + State: finchgo.F("state"), + }), + Manager: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyManager{ + ID: finchgo.F("id"), + }), + MiddleName: finchgo.F("middle_name"), + PhoneNumbers: finchgo.F([]finchgo.SandboxDirectoryNewParamsBodyPhoneNumber{{ + Data: finchgo.F("data"), + Type: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyPhoneNumbersTypeWork), }, { - Name: finchgo.F("name"), - Value: finchgo.F[any](map[string]interface{}{}), + Data: finchgo.F("data"), + Type: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyPhoneNumbersTypeWork), }, { - Name: finchgo.F("name"), - Value: finchgo.F[any](map[string]interface{}{}), + Data: finchgo.F("data"), + Type: finchgo.F(finchgo.SandboxDirectoryNewParamsBodyPhoneNumbersTypeWork), }}), - SourceID: finchgo.F("source_id"), + PreferredName: finchgo.F("preferred_name"), + Residence: finchgo.F(finchgo.LocationParam{ + City: finchgo.F("city"), + Country: finchgo.F("country"), + Line1: finchgo.F("line1"), + Line2: finchgo.F("line2"), + Name: finchgo.F("name"), + PostalCode: finchgo.F("postal_code"), + SourceID: finchgo.F("source_id"), + State: finchgo.F("state"), + }), + SourceID: finchgo.F("source_id"), + Ssn: finchgo.F("ssn"), + StartDate: finchgo.F("start_date"), + Title: finchgo.F("title"), }}, }) if err != nil { diff --git a/sandboxemployment_test.go b/sandboxemployment_test.go index c9a5e1c..e3eecf2 100644 --- a/sandboxemployment_test.go +++ b/sandboxemployment_test.go @@ -46,44 +46,44 @@ func TestSandboxEmploymentUpdateWithOptionalParams(t *testing.T) { Name: finchgo.F("name"), }), Employment: finchgo.F(finchgo.SandboxEmploymentUpdateParamsEmployment{ - Type: finchgo.F(finchgo.SandboxEmploymentUpdateParamsEmploymentTypeEmployee), Subtype: finchgo.F(finchgo.SandboxEmploymentUpdateParamsEmploymentSubtypeFullTime), + Type: finchgo.F(finchgo.SandboxEmploymentUpdateParamsEmploymentTypeEmployee), }), EndDate: finchgo.F("end_date"), FirstName: finchgo.F("first_name"), Income: finchgo.F(finchgo.IncomeParam{ - Unit: finchgo.F(finchgo.IncomeUnitYearly), Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), EffectiveDate: finchgo.F("effective_date"), + Unit: finchgo.F(finchgo.IncomeUnitYearly), }), IncomeHistory: finchgo.F([]finchgo.IncomeParam{{ - Unit: finchgo.F(finchgo.IncomeUnitYearly), Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), EffectiveDate: finchgo.F("effective_date"), - }, { Unit: finchgo.F(finchgo.IncomeUnitYearly), + }, { Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), EffectiveDate: finchgo.F("effective_date"), - }, { Unit: finchgo.F(finchgo.IncomeUnitYearly), + }, { Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), EffectiveDate: finchgo.F("effective_date"), + Unit: finchgo.F(finchgo.IncomeUnitYearly), }}), IsActive: finchgo.F(true), LastName: finchgo.F("last_name"), Location: finchgo.F(finchgo.LocationParam{ - Line1: finchgo.F("line1"), - Line2: finchgo.F("line2"), City: finchgo.F("city"), - State: finchgo.F("state"), - PostalCode: finchgo.F("postal_code"), Country: finchgo.F("country"), + Line1: finchgo.F("line1"), + Line2: finchgo.F("line2"), Name: finchgo.F("name"), + PostalCode: finchgo.F("postal_code"), SourceID: finchgo.F("source_id"), + State: finchgo.F("state"), }), Manager: finchgo.F(finchgo.SandboxEmploymentUpdateParamsManager{ ID: finchgo.F("id"), diff --git a/sandboxindividual_test.go b/sandboxindividual_test.go index ded14a0..531c747 100644 --- a/sandboxindividual_test.go +++ b/sandboxindividual_test.go @@ -60,14 +60,14 @@ func TestSandboxIndividualUpdateWithOptionalParams(t *testing.T) { }}), PreferredName: finchgo.F("preferred_name"), Residence: finchgo.F(finchgo.LocationParam{ - Line1: finchgo.F("line1"), - Line2: finchgo.F("line2"), City: finchgo.F("city"), - State: finchgo.F("state"), - PostalCode: finchgo.F("postal_code"), Country: finchgo.F("country"), + Line1: finchgo.F("line1"), + Line2: finchgo.F("line2"), Name: finchgo.F("name"), + PostalCode: finchgo.F("postal_code"), SourceID: finchgo.F("source_id"), + State: finchgo.F("state"), }), Ssn: finchgo.F("ssn"), }, diff --git a/sandboxpayment_test.go b/sandboxpayment_test.go index 17afe6d..4566b38 100644 --- a/sandboxpayment_test.go +++ b/sandboxpayment_test.go @@ -30,79 +30,79 @@ func TestSandboxPaymentNewWithOptionalParams(t *testing.T) { _, err := client.Sandbox.Payment.New(context.TODO(), finchgo.SandboxPaymentNewParams{ EndDate: finchgo.F("end_date"), PayStatements: finchgo.F([]finchgo.SandboxPaymentNewParamsPayStatement{{ - IndividualID: finchgo.F("b2338cfb-472f-4f72-9faa-e028c083144a"), - Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsTypeRegularPayroll), - PaymentMethod: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsPaymentMethodCheck), - TotalHours: finchgo.F(0.000000), - GrossPay: finchgo.F(finchgo.MoneyParam{ - Amount: finchgo.F(int64(0)), - Currency: finchgo.F("currency"), - }), - NetPay: finchgo.F(finchgo.MoneyParam{ - Amount: finchgo.F(int64(0)), - Currency: finchgo.F("currency"), - }), Earnings: finchgo.F([]finchgo.SandboxPaymentNewParamsPayStatementsEarning{{ - Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsEarningsTypeSalary), - Name: finchgo.F("name"), Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), Hours: finchgo.F(0.000000), - }, { - Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsEarningsTypeSalary), Name: finchgo.F("name"), - Amount: finchgo.F(int64(0)), - Currency: finchgo.F("currency"), - Hours: finchgo.F(0.000000), - }, { Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsEarningsTypeSalary), - Name: finchgo.F("name"), + }, { Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), Hours: finchgo.F(0.000000), - }}), - Taxes: finchgo.F([]finchgo.SandboxPaymentNewParamsPayStatementsTax{{ - Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsTaxesTypeState), Name: finchgo.F("name"), - Employer: finchgo.F(true), - Amount: finchgo.F(int64(0)), - Currency: finchgo.F("currency"), + Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsEarningsTypeSalary), }, { - Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsTaxesTypeState), - Name: finchgo.F("name"), - Employer: finchgo.F(true), Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), - }, { - Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsTaxesTypeState), + Hours: finchgo.F(0.000000), Name: finchgo.F("name"), - Employer: finchgo.F(true), - Amount: finchgo.F(int64(0)), - Currency: finchgo.F("currency"), + Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsEarningsTypeSalary), }}), EmployeeDeductions: finchgo.F([]finchgo.SandboxPaymentNewParamsPayStatementsEmployeeDeduction{{ - Name: finchgo.F("401k test"), Amount: finchgo.F(int64(2000)), Currency: finchgo.F("usd"), + Name: finchgo.F("401k test"), PreTax: finchgo.F(true), Type: finchgo.F(finchgo.BenefitType_401k), }}), EmployerContributions: finchgo.F([]finchgo.SandboxPaymentNewParamsPayStatementsEmployerContribution{{ - Name: finchgo.F("name"), Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), + Name: finchgo.F("name"), Type: finchgo.F(finchgo.BenefitType_401k), }, { + Amount: finchgo.F(int64(0)), + Currency: finchgo.F("currency"), Name: finchgo.F("name"), + Type: finchgo.F(finchgo.BenefitType_401k), + }, { Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), + Name: finchgo.F("name"), Type: finchgo.F(finchgo.BenefitType_401k), + }}), + GrossPay: finchgo.F(finchgo.MoneyParam{ + Amount: finchgo.F(int64(0)), + Currency: finchgo.F("currency"), + }), + IndividualID: finchgo.F("b2338cfb-472f-4f72-9faa-e028c083144a"), + NetPay: finchgo.F(finchgo.MoneyParam{ + Amount: finchgo.F(int64(0)), + Currency: finchgo.F("currency"), + }), + PaymentMethod: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsPaymentMethodCheck), + Taxes: finchgo.F([]finchgo.SandboxPaymentNewParamsPayStatementsTax{{ + Amount: finchgo.F(int64(0)), + Currency: finchgo.F("currency"), + Employer: finchgo.F(true), + Name: finchgo.F("name"), + Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsTaxesTypeState), }, { + Amount: finchgo.F(int64(0)), + Currency: finchgo.F("currency"), + Employer: finchgo.F(true), Name: finchgo.F("name"), + Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsTaxesTypeState), + }, { Amount: finchgo.F(int64(0)), Currency: finchgo.F("currency"), - Type: finchgo.F(finchgo.BenefitType_401k), + Employer: finchgo.F(true), + Name: finchgo.F("name"), + Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsTaxesTypeState), }}), + TotalHours: finchgo.F(0.000000), + Type: finchgo.F(finchgo.SandboxPaymentNewParamsPayStatementsTypeRegularPayroll), }}), StartDate: finchgo.F("start_date"), })