Skip to content

Commit

Permalink
Update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Dec 10, 2021
1 parent c91670d commit 2d52899
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## APIClient 0.0.5

*Dec 10, 2021*

- Make `Configuration` init public - [#10](https://github.com/kean/APIClient/pull/10), thanks to [Theis Egeberg](https://github.com/theisegeberg)
- All `send` methods now return a new `Response<T>` struct containing not just the response value, but also data, request, response, and status code.
- Add `value(for:)` method that returns `T` – a replacement for the old `send` method
- Add `data(for:)` method returning `Response<Data>`
Expand Down
8 changes: 4 additions & 4 deletions Tests/APIClientTests/GitHubAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ private final class GitHubAPIClientDelegate: APIClientDelegate {
func usage() async throws {
let client = APIClient(host: "api.github.com", delegate: GitHubAPIClientDelegate())

let user = try await client.value(for: Resources.user.get)
let emails = try await client.value(for: Resources.user.emails.get)
let _ = try await client.value(for: Resources.user.get)
let _ = try await client.value(for: Resources.user.emails.get)

// try await client.send(Resources.user.emails.delete(["octocat@gmail.com"]))

let followers = try await client.value(for: Resources.users("kean").followers.get)
let _ = try await client.value(for: Resources.users("kean").followers.get)

let user2: User = try await client.value(for: .get("/user"))
let _: User = try await client.value(for: .get("/user"))
}

0 comments on commit 2d52899

Please sign in to comment.