Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 0.0.5 #21

Merged
merged 8 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/handle-release-pr-title-edit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ jobs:
update_pr_content:
name: Update pull request content
if: |
(github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) ||
(github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version') &&
((github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) ||
(github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version')) &&
startsWith(github.event.pull_request.head.ref, 'release-please--') &&
github.event.pull_request.state == 'open' &&
github.event.sender.login != 'stainless-bot' &&
github.repository == 'Finch-API/finch-api-go'
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.4"
".": "0.0.5"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 18
configured_endpoints: 19
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 0.0.5 (2023-10-03)

Full Changelog: [v0.0.4...v0.0.5](https://github.com/Finch-API/finch-api-go/compare/v0.0.4...v0.0.5)

### Features

* **api:** add `/forward` endpoint and other updates ([#25](https://github.com/Finch-API/finch-api-go/issues/25)) ([f16872d](https://github.com/Finch-API/finch-api-go/commit/f16872dc5025c7c6d88673f65a1b5a14a3fa3e65))


### Bug Fixes

* prevent index out of range bug during auto-pagination ([#23](https://github.com/Finch-API/finch-api-go/issues/23)) ([24b06e2](https://github.com/Finch-API/finch-api-go/commit/24b06e23bcfcaf13d5bdeae175348b71bdd0176d))


### Chores

* **docs:** adjust some docstrings ([#26](https://github.com/Finch-API/finch-api-go/issues/26)) ([0dd63e2](https://github.com/Finch-API/finch-api-go/commit/0dd63e219897c5dce9fd26d2aa7380979c9aeb4c))
* **docs:** adjust some docstrings ([#28](https://github.com/Finch-API/finch-api-go/issues/28)) ([23fa6ec](https://github.com/Finch-API/finch-api-go/commit/23fa6ecd1e5633600590d0cea21c8f08eb1fa1f0))
* **tests:** update test examples ([#27](https://github.com/Finch-API/finch-api-go/issues/27)) ([13f64a3](https://github.com/Finch-API/finch-api-go/commit/13f64a3dd1124e7c54f7def4e96df55b41c8c26a))

## 0.0.4 (2023-09-26)

Full Changelog: [v0.0.3...v0.0.4](https://github.com/Finch-API/finch-api-go/compare/v0.0.3...v0.0.4)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/Finch-API/[email protected].4'
go get -u 'github.com/Finch-API/[email protected].5'
```

<!-- x-release-please-end -->
Expand Down
17 changes: 13 additions & 4 deletions account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package finchgo_test
import (
"context"
"errors"
"os"
"testing"

finchgo "github.com/Finch-API/finch-api-go"
Expand All @@ -13,11 +14,15 @@ import (
)

func TestAccountDisconnect(t *testing.T) {
if !testutil.CheckTestServer(t) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
)
_, err := client.Account.Disconnect(context.TODO())
Expand All @@ -31,11 +36,15 @@ func TestAccountDisconnect(t *testing.T) {
}

func TestAccountIntrospect(t *testing.T) {
if !testutil.CheckTestServer(t) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
)
_, err := client.Account.Introspect(context.TODO())
Expand Down
10 changes: 10 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,13 @@ Methods:
Custom Methods:

- VerifySignature

# RequestForwarding
sshariff01 marked this conversation as resolved.
Show resolved Hide resolved

Response Types:

- <a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go">finchgo</a>.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#RequestForwardingForwardResponse">RequestForwardingForwardResponse</a>

Methods:

- <code title="post /forward">client.RequestForwarding.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#RequestForwardingService.Forward">Forward</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go">finchgo</a>.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#RequestForwardingForwardParams">RequestForwardingForwardParams</a>) (<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go">finchgo</a>.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#RequestForwardingForwardResponse">RequestForwardingForwardResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
12 changes: 7 additions & 5 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import (
// interacting with the Finch API. You should not instantiate this client directly,
// and instead use the [NewClient] method instead.
type Client struct {
Options []option.RequestOption
HRIS *HRISService
Providers *ProviderService
Account *AccountService
Webhooks *WebhookService
Options []option.RequestOption
HRIS *HRISService
Providers *ProviderService
Account *AccountService
Webhooks *WebhookService
RequestForwarding *RequestForwardingService
}

// NewClient generates a new client with the default option read from the
Expand All @@ -42,6 +43,7 @@ func NewClient(opts ...option.RequestOption) (r *Client) {
r.Providers = NewProviderService(opts...)
r.Account = NewAccountService(opts...)
r.Webhooks = NewWebhookService(opts...)
r.RequestForwarding = NewRequestForwardingService(opts...)

return
}
30 changes: 27 additions & 3 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,25 @@ import (
"context"
"fmt"
"net/http"
"os"
"testing"
"time"

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

func TestContextCancel(t *testing.T) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
)
cancelCtx, cancel := context.WithCancel(context.Background())
Expand All @@ -35,8 +44,15 @@ func (t *neverTransport) RoundTrip(req *http.Request) (*http.Response, error) {
}

func TestContextCancelDelay(t *testing.T) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
option.WithHTTPClient(&http.Client{Transport: &neverTransport{}}),
)
Expand All @@ -52,6 +68,14 @@ func TestContextCancelDelay(t *testing.T) {
}

func TestContextDeadline(t *testing.T) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}

testTimeout := time.After(3 * time.Second)
testDone := make(chan bool)

Expand All @@ -61,7 +85,7 @@ func TestContextDeadline(t *testing.T) {

go func() {
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
option.WithHTTPClient(&http.Client{Transport: &neverTransport{}}),
)
Expand Down
2 changes: 1 addition & 1 deletion hris.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (r *Location) UnmarshalJSON(data []byte) (err error) {

type Money struct {
// Amount for money object (in cents)
Amount int64 `json:"amount"`
Amount int64 `json:"amount,nullable"`
Currency string `json:"currency"`
JSON moneyJSON
}
Expand Down
41 changes: 31 additions & 10 deletions hrisbenefit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package finchgo_test
import (
"context"
"errors"
"os"
"testing"

finchgo "github.com/Finch-API/finch-api-go"
Expand All @@ -13,11 +14,15 @@ import (
)

func TestHRISBenefitNewWithOptionalParams(t *testing.T) {
if !testutil.CheckTestServer(t) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
)
_, err := client.HRIS.Benefits.New(context.TODO(), finchgo.HRISBenefitNewParams{
Expand All @@ -35,11 +40,15 @@ func TestHRISBenefitNewWithOptionalParams(t *testing.T) {
}

func TestHRISBenefitGet(t *testing.T) {
if !testutil.CheckTestServer(t) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
)
_, err := client.HRIS.Benefits.Get(context.TODO(), "string")
Expand All @@ -53,11 +62,15 @@ func TestHRISBenefitGet(t *testing.T) {
}

func TestHRISBenefitUpdateWithOptionalParams(t *testing.T) {
if !testutil.CheckTestServer(t) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
)
_, err := client.HRIS.Benefits.Update(
Expand All @@ -77,11 +90,15 @@ func TestHRISBenefitUpdateWithOptionalParams(t *testing.T) {
}

func TestHRISBenefitList(t *testing.T) {
if !testutil.CheckTestServer(t) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
)
_, err := client.HRIS.Benefits.List(context.TODO())
Expand All @@ -95,11 +112,15 @@ func TestHRISBenefitList(t *testing.T) {
}

func TestHRISBenefitListSupportedBenefits(t *testing.T) {
if !testutil.CheckTestServer(t) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
)
_, err := client.HRIS.Benefits.ListSupportedBenefits(context.TODO())
Expand Down
25 changes: 19 additions & 6 deletions hrisbenefitindividual_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package finchgo_test
import (
"context"
"errors"
"os"
"testing"

finchgo "github.com/Finch-API/finch-api-go"
Expand All @@ -13,11 +14,15 @@ import (
)

func TestHRISBenefitIndividualEnrolledIDs(t *testing.T) {
if !testutil.CheckTestServer(t) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
)
_, err := client.HRIS.Benefits.Individuals.EnrolledIDs(context.TODO(), "string")
Expand All @@ -31,11 +36,15 @@ func TestHRISBenefitIndividualEnrolledIDs(t *testing.T) {
}

func TestHRISBenefitIndividualGetManyBenefitsWithOptionalParams(t *testing.T) {
if !testutil.CheckTestServer(t) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
)
_, err := client.HRIS.Benefits.Individuals.GetManyBenefits(
Expand All @@ -55,11 +64,15 @@ func TestHRISBenefitIndividualGetManyBenefitsWithOptionalParams(t *testing.T) {
}

func TestHRISBenefitIndividualUnenrollManyWithOptionalParams(t *testing.T) {
if !testutil.CheckTestServer(t) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := finchgo.NewClient(
option.WithBaseURL("http://127.0.0.1:4010"),
option.WithBaseURL(baseURL),
option.WithAccessToken("AccessToken"),
)
_, err := client.HRIS.Benefits.Individuals.UnenrollMany(
Expand Down
Loading