Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose client.search overload with an optional filter argument #406

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]
### Chnaged
- Expose client.search overload with an optional filter argument [#406](https://github.com/azavea/stac4s/pull/406)

## [0.7.0] - 2021-09-21
### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ trait StreamingStacClientF[F[_], G[_], S] extends StacClientF[F, S] {
def collections: G[StacCollection]
def search: G[StacItem]
def search(filter: S): G[StacItem]
def search(filter: Option[S]): G[StacItem]
def items(collectionId: NonEmptyString): G[StacItem]
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ case class SttpStacClientF[F[_]: MonadThrow, S: Lens[*, Option[PaginationToken]]

def search(filter: S): Stream[F, StacItem] = search(filter.some)

private def search(filter: Option[S]): Stream[F, StacItem] = {
def search(filter: Option[S]): Stream[F, StacItem] = {
val emptyJson = JsonObject.empty.asJson
// the initial filter may contain the paginationToken that is used for the initial query
val initialBody = filter.map(_.asJson).getOrElse(emptyJson)
Expand Down