You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -26,8 +24,7 @@ To fetch an initial copy of the gem:
26
24
bundle install
27
25
```
28
26
29
-
To update the version used by your application when updates are pushed to
30
-
GitHub:
27
+
To update the version used by your application when updates are pushed to GitHub:
31
28
32
29
```sh
33
30
bundle update finch-api
@@ -43,14 +40,14 @@ finch = FinchAPI::Client.new(access_token: "My Access Token")
43
40
44
41
page = finch.hris.directory.list
45
42
46
-
puts(page.id)
43
+
item = page.individuals[0]
44
+
45
+
puts(item.id)
47
46
```
48
47
49
48
### Errors
50
49
51
-
When the library is unable to connect to the API, or if the API returns a
52
-
non-success status code (i.e., 4xx or 5xx response), a subclass of
53
-
`FinchAPI::Error` will be thrown:
50
+
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `FinchAPI::Error` will be thrown:
54
51
55
52
```ruby
56
53
begin
@@ -78,10 +75,9 @@ Error codes are as followed:
78
75
79
76
### Retries
80
77
81
-
Certain errors will be automatically retried 2 times by default, with a short
82
-
exponential backoff. Connection errors (for example, due to a network
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
79
+
80
+
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.
85
81
86
82
You can use the `max_retries` option to configure or disable this:
By default, requests will time out after 60 seconds.
101
-
Timeouts are applied separately to the initial connection and the overall request time,
102
-
so in some cases a request could wait 2\*timeout seconds before it fails.
97
+
98
+
Timeouts are applied separately to the initial connection and the overall request time, so in some cases a request could wait 2\*timeout seconds before it fails.
103
99
104
100
You can use the `timeout` option to configure or disable this:
This library is written with [Sorbet type definitions](https://sorbet.org/docs/rbi). However, there is no runtime dependency on the Sorbet runtime.
115
+
116
+
What this means is that while you can use Sorbet to type check your code statically, and benefit from the [Sorbet Language Server](https://sorbet.org/docs/lsp) in your editor, there is no runtime type checking and execution overhead from Sorbet.
117
+
118
+
Due to limitations with the Sorbet type system, where a method otherwise can take an instance of `FinchAPI::BaseModel` class, you will need to use the `**` splat operator to pass the arguments:
119
+
120
+
```ruby
121
+
model =DirectoryListParams.new
122
+
123
+
finch.hris.directory.list(**model)
124
+
```
125
+
116
126
## Versioning
117
127
118
-
This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the
119
-
library is in initial development and has a major version of `0`, APIs may change
120
-
at any time.
128
+
This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.
129
+
130
+
This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.
0 commit comments