diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInput.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInput.cs
index 34953826db7..595953151c8 100644
--- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInput.cs
+++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInput.cs
@@ -80,6 +80,16 @@ public AuthInput(AuthAlgoliaInsights actualInstance)
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
}
+ ///
+ /// Initializes a new instance of the AuthInput class
+ /// with a Dictionary{string, string}
+ ///
+ /// An instance of Dictionary<string, string>.
+ public AuthInput(Dictionary actualInstance)
+ {
+ ActualInstance = actualInstance;
+ }
+
///
/// Gets or Sets ActualInstance
@@ -146,6 +156,16 @@ public AuthAlgoliaInsights AsAuthAlgoliaInsights()
return (AuthAlgoliaInsights)ActualInstance;
}
+ ///
+ /// Get the actual instance of `Dictionary{string, string}`. If the actual instance is not `Dictionary{string, string}`,
+ /// the InvalidClassException will be thrown
+ ///
+ /// An instance of Dictionary<string, string>
+ public Dictionary AsDictionaryString()
+ {
+ return (Dictionary)ActualInstance;
+ }
+
///
/// Check if the actual instance is of `AuthOAuth` type.
@@ -201,6 +221,15 @@ public bool IsAuthAlgoliaInsights()
return ActualInstance.GetType() == typeof(AuthAlgoliaInsights);
}
+ ///
+ /// Check if the actual instance is of `Dictionary{string, string}` type.
+ ///
+ /// Whether or not the instance is the type
+ public bool IsDictionaryString()
+ {
+ return ActualInstance.GetType() == typeof(Dictionary);
+ }
+
///
/// Returns the string presentation of the object
///
@@ -357,6 +386,18 @@ public override AuthInput Read(ref Utf8JsonReader reader, Type typeToConvert, Js
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthAlgoliaInsights: {exception}");
}
}
+ if (root.ValueKind == JsonValueKind.Object)
+ {
+ try
+ {
+ return new AuthInput(jsonDocument.Deserialize>(JsonConfig.Options));
+ }
+ catch (Exception exception)
+ {
+ // deserialization failed, try the next one
+ System.Diagnostics.Debug.WriteLine($"Failed to deserialize into Dictionary: {exception}");
+ }
+ }
throw new InvalidDataException($"The JSON string cannot be deserialized into any schema defined.");
}
diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthenticationType.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthenticationType.cs
index 444a8d24759..059c5528a0f 100644
--- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthenticationType.cs
+++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthenticationType.cs
@@ -52,6 +52,12 @@ public enum AuthenticationType
/// Enum AlgoliaInsights for value: algoliaInsights
///
[JsonPropertyName("algoliaInsights")]
- AlgoliaInsights = 6
+ AlgoliaInsights = 6,
+
+ ///
+ /// Enum Secrets for value: secrets
+ ///
+ [JsonPropertyName("secrets")]
+ Secrets = 7
}
diff --git a/clients/algoliasearch-client-go/algolia/abtesting/client.go b/clients/algoliasearch-client-go/algolia/abtesting/client.go
index aabfeb0b0ee..7d5be59791a 100644
--- a/clients/algoliasearch-client-go/algolia/abtesting/client.go
+++ b/clients/algoliasearch-client-go/algolia/abtesting/client.go
@@ -218,14 +218,14 @@ func reportError(format string, a ...any) error {
}
// A wrapper for strict JSON decoding.
-func newStrictDecoder(data []byte) *json.Decoder {
+func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// A wrapper for validating a struct, returns nil if value is not a struct.
-func validateStruct(v any) error {
+func validateStruct(v any) error {
err := validator.New().Struct(v)
validationErrors, ok := err.(validator.ValidationErrors)
if ok && len(validationErrors) > 0 {
diff --git a/clients/algoliasearch-client-go/algolia/analytics/client.go b/clients/algoliasearch-client-go/algolia/analytics/client.go
index 3f3397fa07c..7ee32a7bb9c 100644
--- a/clients/algoliasearch-client-go/algolia/analytics/client.go
+++ b/clients/algoliasearch-client-go/algolia/analytics/client.go
@@ -218,14 +218,14 @@ func reportError(format string, a ...any) error {
}
// A wrapper for strict JSON decoding.
-func newStrictDecoder(data []byte) *json.Decoder {
+func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// A wrapper for validating a struct, returns nil if value is not a struct.
-func validateStruct(v any) error {
+func validateStruct(v any) error {
err := validator.New().Struct(v)
validationErrors, ok := err.(validator.ValidationErrors)
if ok && len(validationErrors) > 0 {
diff --git a/clients/algoliasearch-client-go/algolia/ingestion/model_auth_input.go b/clients/algoliasearch-client-go/algolia/ingestion/model_auth_input.go
index 650f0a6a31a..8b7756c4df7 100644
--- a/clients/algoliasearch-client-go/algolia/ingestion/model_auth_input.go
+++ b/clients/algoliasearch-client-go/algolia/ingestion/model_auth_input.go
@@ -16,6 +16,7 @@ type AuthInput struct {
AuthBasic *AuthBasic
AuthGoogleServiceAccount *AuthGoogleServiceAccount
AuthOAuth *AuthOAuth
+ MapmapOfStringstring *map[string]string
}
// AuthOAuthAsAuthInput is a convenience function that returns AuthOAuth wrapped in AuthInput.
@@ -60,6 +61,13 @@ func AuthAlgoliaInsightsAsAuthInput(v *AuthAlgoliaInsights) *AuthInput {
}
}
+// map[string]stringAsAuthInput is a convenience function that returns map[string]string wrapped in AuthInput.
+func MapmapOfStringstringAsAuthInput(v map[string]string) *AuthInput {
+ return &AuthInput{
+ MapmapOfStringstring: &v,
+ }
+}
+
// Unmarshal JSON data into one of the pointers in the struct.
func (dst *AuthInput) UnmarshalJSON(data []byte) error {
var err error
@@ -116,6 +124,13 @@ func (dst *AuthInput) UnmarshalJSON(data []byte) error {
} else {
dst.AuthAlgoliaInsights = nil
}
+ // try to unmarshal data into MapmapOfStringstring
+ err = newStrictDecoder(data).Decode(&dst.MapmapOfStringstring)
+ if err == nil && validateStruct(dst.MapmapOfStringstring) == nil {
+ return nil // found the correct type
+ } else {
+ dst.MapmapOfStringstring = nil
+ }
return fmt.Errorf("Data failed to match schemas in oneOf(AuthInput)")
}
@@ -176,6 +191,15 @@ func (src AuthInput) MarshalJSON() ([]byte, error) {
return serialized, nil
}
+ if src.MapmapOfStringstring != nil {
+ serialized, err := json.Marshal(&src.MapmapOfStringstring)
+ if err != nil {
+ return nil, fmt.Errorf("failed to unmarshal one of MapmapOfStringstring of AuthInput: %w", err)
+ }
+
+ return serialized, nil
+ }
+
return nil, nil // no data in oneOf schemas
}
@@ -205,6 +229,10 @@ func (obj AuthInput) GetActualInstance() any {
return *obj.AuthOAuth
}
+ if obj.MapmapOfStringstring != nil {
+ return *obj.MapmapOfStringstring
+ }
+
// all schemas are nil
return nil
}
diff --git a/clients/algoliasearch-client-go/algolia/ingestion/model_authentication_type.go b/clients/algoliasearch-client-go/algolia/ingestion/model_authentication_type.go
index 6dedd29e330..1c4c4ff113b 100644
--- a/clients/algoliasearch-client-go/algolia/ingestion/model_authentication_type.go
+++ b/clients/algoliasearch-client-go/algolia/ingestion/model_authentication_type.go
@@ -17,6 +17,7 @@ const (
AUTHENTICATION_TYPE_OAUTH AuthenticationType = "oauth"
AUTHENTICATION_TYPE_ALGOLIA AuthenticationType = "algolia"
AUTHENTICATION_TYPE_ALGOLIA_INSIGHTS AuthenticationType = "algoliaInsights"
+ AUTHENTICATION_TYPE_SECRETS AuthenticationType = "secrets"
)
// All allowed values of AuthenticationType enum.
@@ -27,6 +28,7 @@ var AllowedAuthenticationTypeEnumValues = []AuthenticationType{
"oauth",
"algolia",
"algoliaInsights",
+ "secrets",
}
func (v *AuthenticationType) UnmarshalJSON(src []byte) error {
diff --git a/clients/algoliasearch-client-go/algolia/insights/client.go b/clients/algoliasearch-client-go/algolia/insights/client.go
index b1d2d614db9..b66560b2dbd 100644
--- a/clients/algoliasearch-client-go/algolia/insights/client.go
+++ b/clients/algoliasearch-client-go/algolia/insights/client.go
@@ -218,14 +218,14 @@ func reportError(format string, a ...any) error {
}
// A wrapper for strict JSON decoding.
-func newStrictDecoder(data []byte) *json.Decoder {
+func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// A wrapper for validating a struct, returns nil if value is not a struct.
-func validateStruct(v any) error {
+func validateStruct(v any) error {
err := validator.New().Struct(v)
validationErrors, ok := err.(validator.ValidationErrors)
if ok && len(validationErrors) > 0 {
diff --git a/clients/algoliasearch-client-go/algolia/monitoring/client.go b/clients/algoliasearch-client-go/algolia/monitoring/client.go
index 83df2930293..e85629db413 100644
--- a/clients/algoliasearch-client-go/algolia/monitoring/client.go
+++ b/clients/algoliasearch-client-go/algolia/monitoring/client.go
@@ -211,14 +211,14 @@ func reportError(format string, a ...any) error {
}
// A wrapper for strict JSON decoding.
-func newStrictDecoder(data []byte) *json.Decoder {
+func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// A wrapper for validating a struct, returns nil if value is not a struct.
-func validateStruct(v any) error {
+func validateStruct(v any) error {
err := validator.New().Struct(v)
validationErrors, ok := err.(validator.ValidationErrors)
if ok && len(validationErrors) > 0 {
diff --git a/clients/algoliasearch-client-go/algolia/personalization/client.go b/clients/algoliasearch-client-go/algolia/personalization/client.go
index 4760b3db51a..eb32eaab0f6 100644
--- a/clients/algoliasearch-client-go/algolia/personalization/client.go
+++ b/clients/algoliasearch-client-go/algolia/personalization/client.go
@@ -214,14 +214,14 @@ func reportError(format string, a ...any) error {
}
// A wrapper for strict JSON decoding.
-func newStrictDecoder(data []byte) *json.Decoder {
+func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// A wrapper for validating a struct, returns nil if value is not a struct.
-func validateStruct(v any) error {
+func validateStruct(v any) error {
err := validator.New().Struct(v)
validationErrors, ok := err.(validator.ValidationErrors)
if ok && len(validationErrors) > 0 {
diff --git a/clients/algoliasearch-client-go/algolia/query-suggestions/client.go b/clients/algoliasearch-client-go/algolia/query-suggestions/client.go
index 1af67f4e4f4..fdbc5cbcf07 100644
--- a/clients/algoliasearch-client-go/algolia/query-suggestions/client.go
+++ b/clients/algoliasearch-client-go/algolia/query-suggestions/client.go
@@ -214,14 +214,14 @@ func reportError(format string, a ...any) error {
}
// A wrapper for strict JSON decoding.
-func newStrictDecoder(data []byte) *json.Decoder {
+func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// A wrapper for validating a struct, returns nil if value is not a struct.
-func validateStruct(v any) error {
+func validateStruct(v any) error {
err := validator.New().Struct(v)
validationErrors, ok := err.(validator.ValidationErrors)
if ok && len(validationErrors) > 0 {
diff --git a/clients/algoliasearch-client-go/algolia/recommend/client.go b/clients/algoliasearch-client-go/algolia/recommend/client.go
index 6f789f6b29d..9881472659e 100644
--- a/clients/algoliasearch-client-go/algolia/recommend/client.go
+++ b/clients/algoliasearch-client-go/algolia/recommend/client.go
@@ -220,14 +220,14 @@ func reportError(format string, a ...any) error {
}
// A wrapper for strict JSON decoding.
-func newStrictDecoder(data []byte) *json.Decoder {
+func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// A wrapper for validating a struct, returns nil if value is not a struct.
-func validateStruct(v any) error {
+func validateStruct(v any) error {
err := validator.New().Struct(v)
validationErrors, ok := err.(validator.ValidationErrors)
if ok && len(validationErrors) > 0 {
diff --git a/clients/algoliasearch-client-go/algolia/search/api_search.go b/clients/algoliasearch-client-go/algolia/search/api_search.go
index 28d9a4c9b79..ad590607d6f 100644
--- a/clients/algoliasearch-client-go/algolia/search/api_search.go
+++ b/clients/algoliasearch-client-go/algolia/search/api_search.go
@@ -9392,7 +9392,7 @@ func (c *APIClient) WaitForTask(
return time.Duration(min(200*count, 5000)) * time.Millisecond
}), WithMaxRetries(50)}, opts...)
- return CreateIterable(
+ return CreateIterable(
func(*GetTaskResponse, error) (*GetTaskResponse, error) {
return c.GetTask(c.NewApiGetTaskRequest(indexName, taskID), toRequestOptions(opts)...)
},
@@ -9426,7 +9426,7 @@ func (c *APIClient) WaitForAppTask(
return time.Duration(min(200*count, 5000)) * time.Millisecond
}), WithMaxRetries(50)}, opts...)
- return CreateIterable(
+ return CreateIterable(
func(*GetTaskResponse, error) (*GetTaskResponse, error) {
return c.GetAppTask(c.NewApiGetAppTaskRequest(taskID), toRequestOptions(opts)...)
},
@@ -9559,7 +9559,7 @@ func (c *APIClient) WaitForApiKey(
return time.Duration(min(200*count, 5000)) * time.Millisecond
}), WithMaxRetries(50)}, opts...)
- return CreateIterable(
+ return CreateIterable(
func(*GetApiKeyResponse, error) (*GetApiKeyResponse, error) {
return c.GetApiKey(c.NewApiGetApiKeyRequest(key), toRequestOptions(opts)...)
},
@@ -9583,7 +9583,7 @@ func (c *APIClient) BrowseObjects(
browseParams BrowseParamsObject,
opts ...IterableOption,
) error {
- _, err := CreateIterable(
+ _, err := CreateIterable(
func(previousResponse *BrowseResponse, previousErr error) (*BrowseResponse, error) {
if previousResponse != nil {
browseParams.Cursor = previousResponse.Cursor
@@ -9623,7 +9623,7 @@ func (c *APIClient) BrowseRules(
hitsPerPage = *searchRulesParams.HitsPerPage
}
- _, err := CreateIterable(
+ _, err := CreateIterable(
func(previousResponse *SearchRulesResponse, previousErr error) (*SearchRulesResponse, error) {
searchRulesParams.HitsPerPage = &hitsPerPage
@@ -9673,7 +9673,7 @@ func (c *APIClient) BrowseSynonyms(
searchSynonymsParams.Page = utils.ToPtr(int32(0))
}
- _, err := CreateIterable(
+ _, err := CreateIterable(
func(previousResponse *SearchSynonymsResponse, previousErr error) (*SearchSynonymsResponse, error) {
searchSynonymsParams.HitsPerPage = &hitsPerPage
diff --git a/clients/algoliasearch-client-go/algolia/search/client.go b/clients/algoliasearch-client-go/algolia/search/client.go
index b39008762c4..efcbf02fc7a 100644
--- a/clients/algoliasearch-client-go/algolia/search/client.go
+++ b/clients/algoliasearch-client-go/algolia/search/client.go
@@ -220,14 +220,14 @@ func reportError(format string, a ...any) error {
}
// A wrapper for strict JSON decoding.
-func newStrictDecoder(data []byte) *json.Decoder {
+func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// A wrapper for validating a struct, returns nil if value is not a struct.
-func validateStruct(v any) error {
+func validateStruct(v any) error {
err := validator.New().Struct(v)
validationErrors, ok := err.(validator.ValidationErrors)
if ok && len(validationErrors) > 0 {
diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/ingestion/AuthInput.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/ingestion/AuthInput.java
index ba6c1f97610..23c64ea253b 100644
--- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/ingestion/AuthInput.java
+++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/ingestion/AuthInput.java
@@ -6,14 +6,44 @@
import com.algolia.exceptions.AlgoliaRuntimeException;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.core.*;
+import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.annotation.*;
import java.io.IOException;
+import java.util.Map;
import java.util.logging.Logger;
/** AuthInput */
@JsonDeserialize(using = AuthInput.Deserializer.class)
public interface AuthInput {
+ // AuthInput as Map wrapper.
+ static AuthInput of(Map value) {
+ return new MapOfStringStringWrapper(value);
+ }
+
+ // AuthInput as Map wrapper.
+ @JsonSerialize(using = MapOfStringStringWrapper.Serializer.class)
+ class MapOfStringStringWrapper implements AuthInput {
+
+ private final Map value;
+
+ MapOfStringStringWrapper(Map value) {
+ this.value = value;
+ }
+
+ public Map getValue() {
+ return value;
+ }
+
+ static class Serializer extends JsonSerializer {
+
+ @Override
+ public void serialize(MapOfStringStringWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException {
+ gen.writeObject(value.getValue());
+ }
+ }
+ }
+
class Deserializer extends JsonDeserializer {
private static final Logger LOGGER = Logger.getLogger(Deserializer.class.getName());
@@ -77,6 +107,16 @@ public AuthInput deserialize(JsonParser jp, DeserializationContext ctxt) throws
LOGGER.finest("Failed to deserialize oneOf AuthAlgoliaInsights (error: " + e.getMessage() + ") (type: AuthAlgoliaInsights)");
}
}
+ // deserialize Map
+ if (tree.isObject()) {
+ try (JsonParser parser = tree.traverse(jp.getCodec())) {
+ Map value = parser.readValueAs(new TypeReference