-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request aws-geospatial#9 from makeen-project/ALMS-133
ALMS-141, ALMS-133
- Loading branch information
Showing
28 changed files
with
314 additions
and
553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
library/src/main/java/software/amazon/location/auth/AmazonLocationClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package software.amazon.location.auth | ||
|
||
|
||
import aws.sdk.kotlin.services.location.LocationClient | ||
import aws.sdk.kotlin.services.location.model.SearchPlaceIndexForPositionRequest | ||
import aws.sdk.kotlin.services.location.model.SearchPlaceIndexForPositionResponse | ||
|
||
/** | ||
* Provides methods to interact with the Amazon Location service. | ||
* | ||
* @property locationClient An instance of LocationClient used for making requests to the Amazon Location service. | ||
*/ | ||
class AmazonLocationClient( | ||
private val locationClient: LocationClient | ||
) { | ||
|
||
/** | ||
* Reverse geocodes a location specified by longitude and latitude coordinates. | ||
* | ||
* @param placeIndexName The name of the place index resource to use for the reverse geocoding request. | ||
* @param longitude The longitude of the location to reverse geocode. | ||
* @param latitude The latitude of the location to reverse geocode. | ||
* @param mLanguage The language to use for the reverse geocoding results. | ||
* @param mMaxResults The maximum number of results to return. | ||
* @return A response containing the reverse geocoding results. | ||
*/ | ||
suspend fun reverseGeocode( | ||
placeIndexName: String, | ||
longitude: Double, | ||
latitude: Double, | ||
mLanguage: String, | ||
mMaxResults: Int | ||
): SearchPlaceIndexForPositionResponse { | ||
val request = SearchPlaceIndexForPositionRequest { | ||
indexName = placeIndexName | ||
position = listOf(longitude, latitude) | ||
maxResults = mMaxResults | ||
language = mLanguage | ||
} | ||
|
||
val response = locationClient.searchPlaceIndexForPosition(request) | ||
return response | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
...ry/src/main/java/software/amazon/location/auth/data/model/request/GetCredentialRequest.kt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...ry/src/main/java/software/amazon/location/auth/data/model/request/GetIdentityIdRequest.kt
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
...y/src/main/java/software/amazon/location/auth/data/model/request/ReverseGeocodeRequest.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.