-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SSDK-544] Replace supportSBS binary with expandable ApiType enum (#162)
### Description Fixes [SSDK-544](https://mapbox.atlassian.net/browse/SSDK-544) - Change AbstractSearchEngine.init `supportSBS: Bool = false` parameter to `apiType: ApiType = .SBS`. - This changes the default API engine for discover/category and other API requests to SBS. - Add ApiType enum to represent non-Autofill and non-PlaceAutocomplete SearchEngine API types. - This will be expanded to include the new [search-box](https://docs.mapbox.com/api/search/search-box/) API type ### Checklist - [x] Update `CHANGELOG` [SSDK-544]: https://mapbox.atlassian.net/browse/SSDK-544
- Loading branch information
Showing
10 changed files
with
64 additions
and
17 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
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
14 changes: 14 additions & 0 deletions
14
Sources/MapboxSearch/InternalAPI/Engine/ApiType+Core.swift
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,14 @@ | ||
// Copyright © 2024 Mapbox. All rights reserved. | ||
|
||
import Foundation | ||
|
||
extension ApiType { | ||
func toCore() -> CoreSearchEngine.ApiType { | ||
switch self { | ||
case .geocoding: | ||
return .geocoding | ||
case .SBS: | ||
return .SBS | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright © 2024 Mapbox. All rights reserved. | ||
|
||
import Foundation | ||
|
||
/// Determine which Mapbox API to use for a SearchEngine instance | ||
public enum ApiType { | ||
/// The Mapbox Geocoding (a.k.a V5) API - https://docs.mapbox.com/api/search/geocoding/ | ||
case geocoding | ||
|
||
/// The Mapbox Single Box Search (a.k.a Federation API) - https://docs.mapbox.com/api/search/search/ | ||
case SBS | ||
} |
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
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