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.3 #8

Merged
merged 8 commits into from
Sep 22, 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
4 changes: 2 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,8 @@ jobs:
update_pr_content:
name: Update pull request content
if: |
(github.event.type == 'edited' && github.event.changes.title.from != github.event.pull_request.title) ||
(github.event.type == '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') &&
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.2"
".": "0.0.3"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 27
configured_endpoints: 18
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## 0.0.3 (2023-09-22)

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

### Features

* retry on 408 Request Timeout ([#7](https://github.com/Finch-API/finch-api-go/issues/7)) ([6075488](https://github.com/Finch-API/finch-api-go/commit/6075488158fc1ea2db4bf1d280a3479ad916bd79))


### Bug Fixes

* **core:** improve retry behavior and related docs ([#9](https://github.com/Finch-API/finch-api-go/issues/9)) ([7107ce5](https://github.com/Finch-API/finch-api-go/commit/7107ce5b8411fa3b44c1de961ddaab4b8f17cf24))


### Chores

* **api:** remove deprecated & unused ATS API ([#12](https://github.com/Finch-API/finch-api-go/issues/12)) ([213405d](https://github.com/Finch-API/finch-api-go/commit/213405d52af5efd4593568a245ba27432e820033))


### Documentation

* **api.md:** rename Top Level to client name ([#14](https://github.com/Finch-API/finch-api-go/issues/14)) ([3030c73](https://github.com/Finch-API/finch-api-go/commit/3030c7354f856084304a175ac637c99e0517b0f7))
* **README:** fix variable names in some examples ([#13](https://github.com/Finch-API/finch-api-go/issues/13)) ([4b23c28](https://github.com/Finch-API/finch-api-go/commit/4b23c2831725bbe854d88fb2e399dd16fa88a8b0))

## 0.0.2 (2023-09-14)

Full Changelog: [v0.0.1...v0.0.2](https://github.com/Finch-API/finch-api-go/compare/v0.0.1...v0.0.2)
Expand Down
25 changes: 12 additions & 13 deletions 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].2'
go get -u 'github.com/Finch-API/[email protected].3'
```

<!-- x-release-please-end -->
Expand All @@ -49,11 +49,11 @@ func main() {
client := finchgo.NewClient(
option.WithAccessToken("my access token"),
)
candidate, err := client.ATS.Candidates.Get(context.TODO(), "<candidate id>")
page, err := client.HRIS.Directory.ListIndividuals(context.TODO(), finchgo.HRISDirectoryListIndividualsParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", candidate.FirstName)
fmt.Printf("%+v\n", page)
}

```
Expand Down Expand Up @@ -142,7 +142,7 @@ client := finchgo.NewClient(
option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.ATS.Candidates.Get(context.TODO(), ...,
client.HRIS.Directory.ListIndividuals(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
Expand All @@ -159,11 +159,11 @@ This library provides some conveniences for working with paginated list endpoint
You can use `.ListAutoPaging()` methods to iterate through items across all pages:

```go
iter := client.ATS.Jobs.ListAutoPaging(context.TODO(), finchgo.ATSJobListParams{})
iter := client.HRIS.Directory.ListIndividualsAutoPaging(context.TODO(), finchgo.HRISDirectoryListIndividualsParams{})
// Automatically fetches more pages as needed.
for iter.Next() {
job := iter.Current()
fmt.Printf("%+v\n", job)
individualInDirectory := iter.Current()
fmt.Printf("%+v\n", individualInDirectory)
}
if err := iter.Err(); err != nil {
panic(err.Error())
Expand All @@ -174,10 +174,10 @@ Or you can use simple `.List()` methods to fetch a single page and receive a sta
with additional helper methods like `.GetNextPage()`, e.g.:

```go
page, err := client.ATS.Jobs.List(context.TODO(), finchgo.ATSJobListParams{})
page, err := client.HRIS.Directory.ListIndividuals(context.TODO(), finchgo.HRISDirectoryListIndividualsParams{})
for page != nil {
for _, job := range page.Jobs {
fmt.Printf("%+v\n", job)
for _, directory := range page.Individuals {
fmt.Printf("%+v\n", directory)
}
page, err = page.GetNextPage()
}
Expand All @@ -202,7 +202,6 @@ if err != nil {
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/directory": 400 Bad Request { ... }
}
Expand Down Expand Up @@ -233,8 +232,8 @@ client.HRIS.Directory.ListIndividuals(
## Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
Connection errors (for example, due to a network connectivity problem), 409 Conflict, 429 Rate Limit,
and >=500 Internal errors will all be retried by default.
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:

Expand Down
58 changes: 1 addition & 57 deletions api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Top Level
# finchgo

# HRIS

Expand Down Expand Up @@ -112,62 +112,6 @@ Methods:
- <code title="get /employer/benefits/{benefit_id}/individuals">client.HRIS.Benefits.Individuals.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#HRISBenefitIndividualService.GetManyBenefits">GetManyBenefits</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, benefitID <a href="https://pkg.go.dev/builtin#string">string</a>, query <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#HRISBenefitIndividualGetManyBenefitsParams">HRISBenefitIndividualGetManyBenefitsParams</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#SinglePage">SinglePage</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#IndividualBenefit">IndividualBenefit</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="delete /employer/benefits/{benefit_id}/individuals">client.HRIS.Benefits.Individuals.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#HRISBenefitIndividualService.UnenrollMany">UnenrollMany</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, benefitID <a href="https://pkg.go.dev/builtin#string">string</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#HRISBenefitIndividualUnenrollManyParams">HRISBenefitIndividualUnenrollManyParams</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#SinglePage">SinglePage</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#UnenrolledIndividual">UnenrolledIndividual</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

# ATS

## Candidates

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#Candidate">Candidate</a>

Methods:

- <code title="get /ats/candidates/{candidate_id}">client.ATS.Candidates.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#ATSCandidateService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, candidateID <a href="https://pkg.go.dev/builtin#string">string</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#Candidate">Candidate</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /ats/candidates">client.ATS.Candidates.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#ATSCandidateService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <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#ATSCandidateListParams">ATSCandidateListParams</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#CandidatesPage">CandidatesPage</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

## Applications

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#Application">Application</a>

Methods:

- <code title="get /ats/applications/{application_id}">client.ATS.Applications.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#ATSApplicationService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, applicationID <a href="https://pkg.go.dev/builtin#string">string</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#Application">Application</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /ats/applications">client.ATS.Applications.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#ATSApplicationService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <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#ATSApplicationListParams">ATSApplicationListParams</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#ApplicationsPage">ApplicationsPage</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

## Stages

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#Stage">Stage</a>

Methods:

- <code title="get /ats/stages">client.ATS.Stages.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#ATSStageService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</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#SinglePage">SinglePage</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#Stage">Stage</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

## Jobs

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#Job">Job</a>

Methods:

- <code title="get /ats/jobs/{job_id}">client.ATS.Jobs.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#ATSJobService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, jobID <a href="https://pkg.go.dev/builtin#string">string</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#Job">Job</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /ats/jobs">client.ATS.Jobs.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#ATSJobService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <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#ATSJobListParams">ATSJobListParams</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#JobsPage">JobsPage</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

## Offers

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#Offer">Offer</a>

Methods:

- <code title="get /ats/offers/{offer_id}">client.ATS.Offers.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#ATSOfferService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, offerID <a href="https://pkg.go.dev/builtin#string">string</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#Offer">Offer</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /ats/offers">client.ATS.Offers.<a href="https://pkg.go.dev/github.com/Finch-API/finch-api-go#ATSOfferService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <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#ATSOfferListParams">ATSOfferListParams</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#OffersPage">OffersPage</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

# Providers

Response Types:
Expand Down
34 changes: 0 additions & 34 deletions ats.go

This file was deleted.

Loading