Skip to content

Commit

Permalink
feat(specs): only use shortname in the source input [skip-bc] (genera…
Browse files Browse the repository at this point in the history
…ted)

algolia/api-clients-automation#4287

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
  • Loading branch information
algolia-bot and millotp committed Jan 8, 2025
1 parent 89e7f10 commit 82e561c
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 135 deletions.
53 changes: 0 additions & 53 deletions src/main/scala/algoliasearch/ingestion/DockerImageType.scala

This file was deleted.

53 changes: 0 additions & 53 deletions src/main/scala/algoliasearch/ingestion/DockerRegistry.scala

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/scala/algoliasearch/ingestion/JsonSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ object JsonSupport {
new BigQueryDataTypeSerializer() :+
new DestinationSortKeysSerializer() :+
new DestinationTypeSerializer() :+
new DockerImageTypeSerializer() :+
new DockerRegistrySerializer() :+
new DockerStreamsSyncModeSerializer() :+
new EntityTypeSerializer() :+
new EventSortKeysSerializer() :+
Expand Down
10 changes: 1 addition & 9 deletions src/main/scala/algoliasearch/ingestion/SourceDocker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,14 @@
*/
package algoliasearch.ingestion

import algoliasearch.ingestion.DockerImageType._
import algoliasearch.ingestion.DockerRegistry._

/** SourceDocker
*
* @param image
* Docker image name.
* @param version
* Docker image version.
* Shortname of the image, as returned by the referential.
* @param configuration
* Configuration of the spec.
*/
case class SourceDocker(
imageType: DockerImageType,
registry: DockerRegistry,
image: String,
version: Option[String] = scala.None,
configuration: Any
) extends SourceInputTrait
11 changes: 3 additions & 8 deletions src/main/scala/algoliasearch/ingestion/SourceInput.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
package algoliasearch.ingestion

import algoliasearch.ingestion.BigQueryDataType._
import algoliasearch.ingestion.DockerImageType._
import algoliasearch.ingestion.DockerRegistry._
import algoliasearch.ingestion.MappingTypeCSV._
import algoliasearch.ingestion.MethodType._

Expand All @@ -40,15 +38,12 @@ object SourceInputSerializer extends Serializer[SourceInput] {

case (TypeInfo(clazz, _), json) if clazz == classOf[SourceInput] =>
json match {
case value: JObject
if value.obj.exists(_._1 == "registry") && value.obj.exists(_._1 == "image") && value.obj.exists(
_._1 == "imageType"
) && value.obj.exists(_._1 == "configuration") =>
Extraction.extract[SourceDocker](value)
case value: JObject
if value.obj.exists(_._1 == "projectID") && value.obj
.exists(_._1 == "datasetID") && value.obj.exists(_._1 == "tablePrefix") =>
Extraction.extract[SourceGA4BigQueryExport](value)
case value: JObject if value.obj.exists(_._1 == "image") && value.obj.exists(_._1 == "configuration") =>
Extraction.extract[SourceDocker](value)
case value: JObject if value.obj.exists(_._1 == "projectKey") => Extraction.extract[SourceCommercetools](value)
case value: JObject if value.obj.exists(_._1 == "storeHash") => Extraction.extract[SourceBigCommerce](value)
case value: JObject if value.obj.exists(_._1 == "projectID") => Extraction.extract[SourceBigQuery](value)
Expand All @@ -61,8 +56,8 @@ object SourceInputSerializer extends Serializer[SourceInput] {

override def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { case value: SourceInput =>
value match {
case value: SourceDocker => Extraction.decompose(value)(format - this)
case value: SourceGA4BigQueryExport => Extraction.decompose(value)(format - this)
case value: SourceDocker => Extraction.decompose(value)(format - this)
case value: SourceCommercetools => Extraction.decompose(value)(format - this)
case value: SourceBigCommerce => Extraction.decompose(value)(format - this)
case value: SourceBigQuery => Extraction.decompose(value)(format - this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,11 @@
*/
package algoliasearch.ingestion

import algoliasearch.ingestion.DockerRegistry._

/** SourceUpdateDocker
*
* @param image
* Docker image name.
* @param version
* Docker image version.
* @param configuration
* Configuration of the spec.
*/
case class SourceUpdateDocker(
registry: Option[DockerRegistry] = scala.None,
image: Option[String] = scala.None,
version: Option[String] = scala.None,
configuration: Any
) extends SourceUpdateInputTrait
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package algoliasearch.ingestion

import algoliasearch.ingestion.BigQueryDataType._
import algoliasearch.ingestion.DockerRegistry._
import algoliasearch.ingestion.MappingTypeCSV._
import algoliasearch.ingestion.MethodType._

Expand Down

0 comments on commit 82e561c

Please sign in to comment.