Skip to content

Commit

Permalink
Update DocC
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino committed Oct 11, 2024
1 parent aaa0167 commit 88c0d9b
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 51 deletions.
76 changes: 51 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Use this web-based service to streamline your app’s API by moving georelated s
Use the SPM string to easily include the dependendency in your `Package.swift` file

```swift
.package(url: "https://github.com/fpseverino/apple-maps-kit.git", from: "0.1.0")
.package(url: "https://github.com/fpseverino/apple-maps-kit.git", from: "0.2.0")
```

and add it to your target's dependencies:
Expand All @@ -36,10 +36,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let places = try await client.geocode(address: "1 Apple Park, Cupertino, CA")
Expand All @@ -58,10 +58,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let places = try await client.reverseGeocode(latitude: 37.33182, longitude: -122.03118)
Expand All @@ -80,10 +80,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let searchResponse = try await client.search(for: "eiffel tower")
Expand All @@ -102,10 +102,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let results = try await client.searchAutoComplete(for: "eiffel")
Expand All @@ -124,10 +124,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let directions = try await client.directions(
Expand All @@ -149,10 +149,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let coordinateEtas = try await client.eta(
Expand All @@ -168,3 +168,29 @@ let addressEtas = try await client.etaBetweenAddresses(
to: ["Golden Gate Park, San Francisco"],
)
```

### Search for places using identifiers

Obtain a set of ``Place`` objects for a given set of Place IDs or get a list of alternate Place IDs given one or more Place IDs.

```swift
import AppleMapsKit
import AsyncHTTPClient

let client = try await AppleMapsClient(
httpClient: HTTPClient(...),
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let place = try await client.place(id: "I7C250D2CDCB364A")

let placesResponse = try await client.places(ids: ["ICFA2FAE5487B94AF", "IA6FD1E86A544F69D"])

let alternateIDsResponse = try await client.alternatePlaceIDs(ids: ["I7C250D2CDCB364A", "ICFA2FAE5487B94AF"])
```
10 changes: 8 additions & 2 deletions Sources/AppleMapsKit/AppleMapsKit.docc/AppleMapsKit.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Use this web-based service to streamline your app’s API by moving georelated s
Use the SPM string to easily include the dependendency in your `Package.swift` file

```swift
.package(url: "https://github.com/fpseverino/apple-maps-kit.git", from: "0.1.0")
.package(url: "https://github.com/fpseverino/apple-maps-kit.git", from: "0.2.0")
```

and add it to your target's dependencies:
Expand All @@ -28,12 +28,12 @@ and add it to your target's dependencies:
- ``MapRegion``
- ``Location``
- ``StructuredAddress``
- ``Place``

### Geocoding

- <doc:Geocode>
- <doc:ReverseGeocode>
- ``Place``

### Searching

Expand All @@ -59,6 +59,12 @@ and add it to your target's dependencies:
- ``Eta``
- ``EtaTransportType``

### Places

- <doc:GettingPlaces>
- ``PlacesResponse``
- ``AlternateIDsResponse``

### Errors

- ``ErrorResponse``
Expand Down
8 changes: 4 additions & 4 deletions Sources/AppleMapsKit/AppleMapsKit.docc/Geocode.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let places = try await client.geocode(address: "1 Apple Park, Cupertino, CA")
Expand Down
8 changes: 4 additions & 4 deletions Sources/AppleMapsKit/AppleMapsKit.docc/GettingDirections.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let directions = try await client.directions(
Expand Down
8 changes: 4 additions & 4 deletions Sources/AppleMapsKit/AppleMapsKit.docc/GettingETAs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let coordinateEtas = try await client.eta(
Expand Down
27 changes: 27 additions & 0 deletions Sources/AppleMapsKit/AppleMapsKit.docc/GettingPlaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Search for places using identifiers

Obtain a set of ``Place`` objects for a given set of Place IDs or get a list of alternate Place IDs given one or more Place IDs.

## Overview

```swift
import AppleMapsKit
import AsyncHTTPClient

let client = try await AppleMapsClient(
httpClient: HTTPClient(...),
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let place = try await client.place(id: "I7C250D2CDCB364A")

let placesResponse = try await client.places(ids: ["ICFA2FAE5487B94AF", "IA6FD1E86A544F69D"])

let alternateIDsResponse = try await client.alternatePlaceIDs(ids: ["I7C250D2CDCB364A", "ICFA2FAE5487B94AF"])
```
8 changes: 4 additions & 4 deletions Sources/AppleMapsKit/AppleMapsKit.docc/ReverseGeocode.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let places = try await client.reverseGeocode(latitude: 37.33182, longitude: -122.03118)
Expand Down
8 changes: 4 additions & 4 deletions Sources/AppleMapsKit/AppleMapsKit.docc/Search.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let searchResponse = try await client.search(for: "eiffel tower")
Expand Down
8 changes: 4 additions & 4 deletions Sources/AppleMapsKit/AppleMapsKit.docc/SearchAutoComplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ let client = try await AppleMapsClient(
teamID: "DEF123GHIJ",
keyID: "ABC123DEFG",
key: """
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"""
)

let results = try await client.searchAutoComplete(for: "eiffel")
Expand Down

0 comments on commit 88c0d9b

Please sign in to comment.