diff --git a/modules/library/src/main/scala/zio/elasticsearch/ElasticRequest.scala b/modules/library/src/main/scala/zio/elasticsearch/ElasticRequest.scala index 019836a44..abaa01136 100644 --- a/modules/library/src/main/scala/zio/elasticsearch/ElasticRequest.scala +++ b/modules/library/src/main/scala/zio/elasticsearch/ElasticRequest.scala @@ -21,7 +21,7 @@ import zio.elasticsearch.Routing.{Routing, WithRouting} import zio.prelude._ import zio.schema.Schema import zio.schema.codec.JsonCodec.JsonDecoder -import zio.{Chunk, RIO, ZIO} +import zio.{RIO, ZIO} import scala.annotation.unused import scala.language.implicitConversions @@ -116,7 +116,7 @@ object ElasticRequest { } private[elasticsearch] final case class BulkRequest( - requests: Chunk[BulkableRequest], + requests: List[BulkableRequest], index: Option[IndexName], refresh: Boolean, routing: Option[Routing] @@ -145,7 +145,7 @@ object ElasticRequest { object BulkRequest { def of(requests: BulkableRequest*): BulkRequest = - BulkRequest(requests = Chunk.fromIterable(requests), index = None, refresh = false, routing = None) + BulkRequest(requests = requests.toList, index = None, refresh = false, routing = None) } private[elasticsearch] final case class CreateRequest( diff --git a/modules/library/src/main/scala/zio/elasticsearch/TestExecutor.scala b/modules/library/src/main/scala/zio/elasticsearch/TestExecutor.scala index 3292052f6..0edc825ba 100644 --- a/modules/library/src/main/scala/zio/elasticsearch/TestExecutor.scala +++ b/modules/library/src/main/scala/zio/elasticsearch/TestExecutor.scala @@ -20,7 +20,7 @@ import zio.Random.nextUUID import zio.elasticsearch.ElasticRequest._ import zio.json.ast.Json import zio.stm.{STM, TMap, ZSTM} -import zio.{Chunk, Task, ZIO} +import zio.{Task, ZIO} private[elasticsearch] final case class TestExecutor private (data: TMap[IndexName, TMap[DocumentId, Document]]) extends ElasticExecutor { @@ -54,7 +54,7 @@ private[elasticsearch] final case class TestExecutor private (data: TMap[IndexNa execute(map.request).flatMap(a => ZIO.fromEither(map.mapper(a))) } - private def fakeBulk(requests: Chunk[BulkableRequest]): Task[Unit] = + private def fakeBulk(requests: List[BulkableRequest]): Task[Unit] = ZIO.attempt { requests.map(_.request).map { r => execute(r)