Skip to content

Commit

Permalink
External IDs; 1.0.0-beta.29.1 release. (#38)
Browse files Browse the repository at this point in the history
* External IDs; 1.0.0-beta.29.1 release.

* Update public API
  • Loading branch information
DzmitryFomchyn authored May 13, 2022
1 parent 69a683a commit 4c86f97
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Internal changelog for the Mapbox Search SDK for Android

## 1.0.0-beta.30-SNAPSHOT
## 1.0.0-beta.29.1

### New features
- [CORE] `SearchResult` and `SearchSuggestion` now provide `externalIDs` property.

### Mapbox dependencies
- Search Native SDK `0.52.0`
Expand Down
2 changes: 1 addition & 1 deletion MapboxSearch/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ android.enableJetifier=false
kotlin.code.style=official

# SDK version attributes
VERSION_NAME=1.0.0-beta.29
VERSION_NAME=1.0.0-beta.29.1

# Artifact attributes
mapboxArtifactUserOrg=mapbox
Expand Down
4 changes: 4 additions & 0 deletions MapboxSearch/sdk/api/api-metalava.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,7 @@ package com.mapbox.search.result {
method public String? getDescriptionText();
method public Double? getDistanceMeters();
method public Double? getEtaMinutes();
method public java.util.Map<java.lang.String,java.lang.String> getExternalIDs();
method public String getId();
method public String? getMakiIcon();
method public String? getMatchingName();
Expand All @@ -1337,6 +1338,7 @@ package com.mapbox.search.result {
property public abstract String? descriptionText;
property public abstract Double? distanceMeters;
property public abstract Double? etaMinutes;
property public abstract java.util.Map<java.lang.String,java.lang.String> externalIDs;
property public abstract String id;
property public abstract String? makiIcon;
property public abstract String? matchingName;
Expand Down Expand Up @@ -1373,6 +1375,7 @@ package com.mapbox.search.result {
method public String? getDescriptionText();
method public Double? getDistanceMeters();
method public Double? getEtaMinutes();
method public java.util.Map<java.lang.String,java.lang.String> getExternalIDs();
method public String getId();
method public String? getMakiIcon();
method public String? getMatchingName();
Expand All @@ -1387,6 +1390,7 @@ package com.mapbox.search.result {
property public abstract String? descriptionText;
property public abstract Double? distanceMeters;
property public abstract Double? etaMinutes;
property public abstract java.util.Map<java.lang.String,java.lang.String> externalIDs;
property public abstract String id;
property public abstract boolean isBatchResolveSupported;
property public abstract String? makiIcon;
Expand Down
2 changes: 2 additions & 0 deletions MapboxSearch/sdk/api/sdk.api
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,7 @@ public abstract interface class com/mapbox/search/result/SearchResult : android/
public abstract fun getDescriptionText ()Ljava/lang/String;
public abstract fun getDistanceMeters ()Ljava/lang/Double;
public abstract fun getEtaMinutes ()Ljava/lang/Double;
public abstract fun getExternalIDs ()Ljava/util/Map;
public abstract fun getId ()Ljava/lang/String;
public abstract fun getMakiIcon ()Ljava/lang/String;
public abstract fun getMatchingName ()Ljava/lang/String;
Expand Down Expand Up @@ -1465,6 +1466,7 @@ public abstract interface class com/mapbox/search/result/SearchSuggestion : andr
public abstract fun getDescriptionText ()Ljava/lang/String;
public abstract fun getDistanceMeters ()Ljava/lang/Double;
public abstract fun getEtaMinutes ()Ljava/lang/Double;
public abstract fun getExternalIDs ()Ljava/util/Map;
public abstract fun getId ()Ljava/lang/String;
public abstract fun getMakiIcon ()Ljava/lang/String;
public abstract fun getMatchingName ()Ljava/lang/String;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mapbox.search.result

import com.mapbox.search.SearchResultMetadata
import java.util.Collections

internal abstract class BaseSearchResult(
@Transient
Expand Down Expand Up @@ -38,6 +39,9 @@ internal abstract class BaseSearchResult(
override val metadata: SearchResultMetadata?
get() = originalSearchResult.metadata

override val externalIDs: Map<String, String>
get() = Collections.unmodifiableMap(originalSearchResult.externalIDs ?: emptyMap())

override val distanceMeters: Double?
get() = originalSearchResult.distanceMeters

Expand All @@ -58,6 +62,7 @@ internal abstract class BaseSearchResult(
"types='$types', " +
"etaMinutes='$etaMinutes', " +
"metadata='$metadata', " +
"externalIDs='$externalIDs`, " +
"distanceMeters='$distanceMeters', " +
"serverIndex='$serverIndex', " +
"requestOptions='$requestOptions'" +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mapbox.search.result

import com.mapbox.search.SearchResultMetadata
import java.util.Collections

internal sealed class BaseSearchSuggestion(
@Transient
Expand Down Expand Up @@ -37,6 +38,9 @@ internal sealed class BaseSearchSuggestion(
override val metadata: SearchResultMetadata?
get() = originalSearchResult.metadata

override val externalIDs: Map<String, String>
get() = Collections.unmodifiableMap(originalSearchResult.externalIDs ?: emptyMap())

override val isBatchResolveSupported: Boolean
get() = originalSearchResult.action?.multiRetrievable == true

Expand All @@ -55,6 +59,7 @@ internal sealed class BaseSearchSuggestion(
"type='$type', " +
"etaMinutes='$etaMinutes', " +
"metadata='$metadata', " +
"externalIDs='$externalIDs`, " +
"isBatchResolveSupported='$isBatchResolveSupported', " +
"serverIndex='$serverIndex', " +
"requestOptions='$requestOptions'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public sealed interface SearchResult : Parcelable {
*/
public val metadata: SearchResultMetadata?

/**
* Experimental API, can be changed or removed in the next SDK releases.
* Map of external ids. Returned Map instance is unmodifiable.
*/
public val externalIDs: Map<String, String>

/**
* Distance in meters from result to requested origin (for forward geocoding and category search) or provided point (for reverse geocoding).
* For provided point always returns non-null distance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ public sealed interface SearchSuggestion : Parcelable {
*/
public val metadata: SearchResultMetadata?

/**
* Experimental API, can be changed or removed in the next SDK releases.
* Map of external ids. Returned Map instance is unmodifiable.
*/
public val externalIDs: Map<String, String>

/**
* Denotes whether this suggestion can be passed as a parameter to a batch selection method of the [com.mapbox.search.SearchEngine].
*/
Expand Down

0 comments on commit 4c86f97

Please sign in to comment.