Skip to content

Commit

Permalink
fix: cleaner regex output (generated)
Browse files Browse the repository at this point in the history
Co-authored-by: shortcuts <vannicattec@gmail.com>
  • Loading branch information
algolia-bot and shortcuts committed Oct 28, 2024
1 parent d994ac6 commit b9b8e14
Show file tree
Hide file tree
Showing 48 changed files with 206 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,24 @@ public enum SynonymType
/// Enum Placeholder for value: placeholder
/// </summary>
[JsonPropertyName("placeholder")]
Placeholder = 5
Placeholder = 5,

/// <summary>
/// Enum OneWaySynonym for value: oneWaySynonym
/// </summary>
[JsonPropertyName("oneWaySynonym")]
OneWaySynonym = 6,

/// <summary>
/// Enum AltCorrection1 for value: altCorrection1
/// </summary>
[JsonPropertyName("altCorrection1")]
AltCorrection1 = 7,

/// <summary>
/// Enum AltCorrection2 for value: altCorrection2
/// </summary>
[JsonPropertyName("altCorrection2")]
AltCorrection2 = 8
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ enum SynonymType {
onewaysynonym(r'onewaysynonym'),
altcorrection1(r'altcorrection1'),
altcorrection2(r'altcorrection2'),
placeholder(r'placeholder');
placeholder(r'placeholder'),
oneWaySynonym(r'oneWaySynonym'),
altCorrection1(r'altCorrection1'),
altCorrection2(r'altCorrection2');

const SynonymType(this.raw);
final dynamic raw;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public enum BigQueryDataType {
GA_4("ga4"),

GA_36_0("ga360");
GA_360("ga360");

private final String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ public enum SynonymType {

ALTCORRECTION_2("altcorrection2"),

PLACEHOLDER("placeholder");
PLACEHOLDER("placeholder"),

ONE_WAY_SYNONYM("oneWaySynonym"),

ALT_CORRECTION_1("altCorrection1"),

ALT_CORRECTION_2("altCorrection2");

private final String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@
/**
* Synonym type.
*/
export type SynonymType = 'synonym' | 'onewaysynonym' | 'altcorrection1' | 'altcorrection2' | 'placeholder';
export type SynonymType =
| 'synonym'
| 'onewaysynonym'
| 'altcorrection1'
| 'altcorrection2'
| 'placeholder'
| 'oneWaySynonym'
| 'altCorrection1'
| 'altCorrection2';
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ public enum class SynonymType(public val value: kotlin.String) {
Altcorrection2("altcorrection2"),

@SerialName(value = "placeholder")
Placeholder("placeholder");
Placeholder("placeholder"),

@SerialName(value = "oneWaySynonym")
OneWaySynonym("oneWaySynonym"),

@SerialName(value = "altCorrection1")
AltCorrection1("altCorrection1"),

@SerialName(value = "altCorrection2")
AltCorrection2("altCorrection2");

override fun toString(): kotlin.String = value
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ class SynonymType

public const PLACEHOLDER = 'placeholder';

public const ONE_WAY_SYNONYM = 'oneWaySynonym';

public const ALT_CORRECTION1 = 'altCorrection1';

public const ALT_CORRECTION2 = 'altCorrection2';

/**
* Gets allowable values of the enum.
*
Expand All @@ -39,6 +45,9 @@ public static function getAllowableEnumValues()
self::ALTCORRECTION1,
self::ALTCORRECTION2,
self::PLACEHOLDER,
self::ONE_WAY_SYNONYM,
self::ALT_CORRECTION1,
self::ALT_CORRECTION2,
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class BigQueryDataType(str, Enum):
"""
allowed enum values
"""
GA4 = "ga4"
GA_4 = "ga4"

GA360 = "ga360"
GA_360 = "ga360"

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MappingFormatSchema(str, Enum):
"""
allowed enum values
"""
MAPPINGKIT_SLASH_V1 = "mappingkit/v1"
MAPPINGKIT_V_1 = "mappingkit/v1"

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class FbtModel(str, Enum):
"""
allowed enum values
"""
BOUGHT_MINUS_TOGETHER = "bought-together"
BOUGHT_TOGETHER = "bought-together"

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class LookingSimilarModel(str, Enum):
"""
allowed enum values
"""
LOOKING_MINUS_SIMILAR = "looking-similar"
LOOKING_SIMILAR = "looking-similar"

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ class RecommendModels(str, Enum):
"""
allowed enum values
"""
RELATED_MINUS_PRODUCTS = "related-products"
RELATED_PRODUCTS = "related-products"

BOUGHT_MINUS_TOGETHER = "bought-together"
BOUGHT_TOGETHER = "bought-together"

TRENDING_MINUS_FACETS = "trending-facets"
TRENDING_FACETS = "trending-facets"

TRENDING_MINUS_ITEMS = "trending-items"
TRENDING_ITEMS = "trending-items"

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RecommendedForYouModel(str, Enum):
"""
allowed enum values
"""
RECOMMENDED_MINUS_FOR_MINUS_YOU = "recommended-for-you"
RECOMMENDED_FOR_YOU = "recommended-for-you"

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RelatedModel(str, Enum):
"""
allowed enum values
"""
RELATED_MINUS_PRODUCTS = "related-products"
RELATED_PRODUCTS = "related-products"

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class SupportedLanguage(str, Enum):

PT = "pt"

PT_MINUS_BR = "pt-br"
PT_BR = "pt-br"

QU = "qu"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TrendingFacetsModel(str, Enum):
"""
allowed enum values
"""
TRENDING_MINUS_FACETS = "trending-facets"
TRENDING_FACETS = "trending-facets"

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TrendingItemsModel(str, Enum):
"""
allowed enum values
"""
TRENDING_MINUS_ITEMS = "trending-items"
TRENDING_ITEMS = "trending-items"

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class SupportedLanguage(str, Enum):

PT = "pt"

PT_MINUS_BR = "pt-br"
PT_BR = "pt-br"

QU = "qu"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ class SynonymType(str, Enum):

ONEWAYSYNONYM = "onewaysynonym"

ALTCORRECTION1 = "altcorrection1"
ALTCORRECTION_1 = "altcorrection1"

ALTCORRECTION2 = "altcorrection2"
ALTCORRECTION_2 = "altcorrection2"

PLACEHOLDER = "placeholder"

ONE_WAY_SYNONYM = "oneWaySynonym"

ALTCORRECTION1 = "altCorrection1"

ALTCORRECTION2 = "altCorrection2"

@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of SynonymType from a JSON string"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,21 @@ class SynonymType
ALTCORRECTION1 = "altcorrection1".freeze
ALTCORRECTION2 = "altcorrection2".freeze
PLACEHOLDER = "placeholder".freeze
ONE_WAY_SYNONYM = "oneWaySynonym".freeze
ALT_CORRECTION1 = "altCorrection1".freeze
ALT_CORRECTION2 = "altCorrection2".freeze

def self.all_vars
@all_vars ||= [SYNONYM, ONEWAYSYNONYM, ALTCORRECTION1, ALTCORRECTION2, PLACEHOLDER].freeze
@all_vars ||= [
SYNONYM,
ONEWAYSYNONYM,
ALTCORRECTION1,
ALTCORRECTION2,
PLACEHOLDER,
ONE_WAY_SYNONYM,
ALT_CORRECTION1,
ALT_CORRECTION2
].freeze
end

# Builds the enum from string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,25 @@ object SynonymType {
case object Placeholder extends SynonymType {
override def toString = "placeholder"
}
val values: Seq[SynonymType] = Seq(Synonym, Onewaysynonym, Altcorrection1, Altcorrection2, Placeholder)
case object OneWaySynonym extends SynonymType {
override def toString = "oneWaySynonym"
}
case object AltCorrection1 extends SynonymType {
override def toString = "altCorrection1"
}
case object AltCorrection2 extends SynonymType {
override def toString = "altCorrection2"
}
val values: Seq[SynonymType] = Seq(
Synonym,
Onewaysynonym,
Altcorrection1,
Altcorrection2,
Placeholder,
OneWaySynonym,
AltCorrection1,
AltCorrection2
)

def withName(name: String): SynonymType = SynonymType.values
.find(_.toString == name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public enum SynonymType: String, Codable, CaseIterable {
case altcorrection1
case altcorrection2
case placeholder
case oneWaySynonym
case altCorrection1
case altCorrection2
}

extension SynonymType: Hashable {}
3 changes: 3 additions & 0 deletions specs/bundled/search.doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19782,6 +19782,9 @@ components:
- altcorrection1
- altcorrection2
- placeholder
- oneWaySynonym
- altCorrection1
- altCorrection2
synonymHit:
type: object
description: Synonym object.
Expand Down
3 changes: 3 additions & 0 deletions specs/bundled/search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6768,6 +6768,9 @@ components:
- altcorrection1
- altcorrection2
- placeholder
- oneWaySynonym
- altCorrection1
- altCorrection2
synonymHit:
type: object
description: Synonym object.
Expand Down
4 changes: 2 additions & 2 deletions tests/output/csharp/src/generated/e2e/Insights.test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public async Task PushEventsTest1()
Index = "products",
UserToken = "user-123456",
AuthenticatedUserToken = "user-123456",
Timestamp = 1729641600000L,
Timestamp = 1729900800000L,
ObjectIDs = new List<string> { "9780545139700", "9780439784542" },
QueryID = "43b15df305339e827f0ac0bdc5ebcaa7",
}
Expand All @@ -76,7 +76,7 @@ public async Task PushEventsTest1()
Index = "products",
UserToken = "user-123456",
AuthenticatedUserToken = "user-123456",
Timestamp = 1729641600000L,
Timestamp = 1729900800000L,
ObjectIDs = new List<string> { "9780545139700", "9780439784542" },
}
),
Expand Down
Loading

0 comments on commit b9b8e14

Please sign in to comment.