From ff83908734e7283c856bbf91379109218b1945f7 Mon Sep 17 00:00:00 2001 From: Dimitrije Bulaja Date: Fri, 25 Nov 2022 15:31:49 +0100 Subject: [PATCH] Rename apply to from in Document --- modules/library/src/main/scala/zio/elasticsearch/Document.scala | 2 +- .../src/main/scala/zio/elasticsearch/ElasticRequest.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/library/src/main/scala/zio/elasticsearch/Document.scala b/modules/library/src/main/scala/zio/elasticsearch/Document.scala index 31926444f..40d9fbcf4 100644 --- a/modules/library/src/main/scala/zio/elasticsearch/Document.scala +++ b/modules/library/src/main/scala/zio/elasticsearch/Document.scala @@ -9,7 +9,7 @@ private[elasticsearch] final case class Document(json: String) { } private[elasticsearch] object Document { - def apply[A](doc: A)(implicit schema: Schema[A]): Document = Document( + def from[A](doc: A)(implicit schema: Schema[A]): Document = Document( JsonCodec.jsonEncoder(schema).encodeJson(a = doc, indent = None).toString ) } diff --git a/modules/library/src/main/scala/zio/elasticsearch/ElasticRequest.scala b/modules/library/src/main/scala/zio/elasticsearch/ElasticRequest.scala index b359e591a..ef83d8ff5 100644 --- a/modules/library/src/main/scala/zio/elasticsearch/ElasticRequest.scala +++ b/modules/library/src/main/scala/zio/elasticsearch/ElasticRequest.scala @@ -30,7 +30,7 @@ object ElasticRequest { doc: A, routing: Option[Routing] = None ): ElasticRequest[Unit] = - Put(index, id, Document(doc), routing) + Put(index, id, Document.from(doc), routing) private[elasticsearch] final case class GetById( index: IndexName,