<commit_before>package com.amazonaws.util.awsclientgenerator.domainmodels.endpoints;

import com.google.gson.*;

import java.lang.reflect.Type;
import java.util.Map;

public class EndpointTestParamsDeserializer implements JsonDeserializer<EndpointTests.EndpointTestParams> {

    @Override
    public EndpointTests.EndpointTestParams deserialize(JsonElement jsonElement, Type type,
                                                        JsonDeserializationContext context) throws JsonParseException {
        EndpointTests.EndpointTestParams retValue = new EndpointTests.EndpointTestParams();

        if (!jsonElement.isJsonObject()) {
            throw new JsonParseException("Unexpected params JSON value type, object expected!");
        }

        JsonObject object = jsonElement.getAsJsonObject();

        for(Map.Entry<String, JsonElement> entry : object.entrySet()) {
            String parameterName = entry.getKey();
            JsonElement subJsonElement = entry.getValue();

            EndpointTests.EndpointTestParameter parameter = new EndpointTests.EndpointTestParameter();
            parameter.setName(parameterName);

            if (subJsonElement.isJsonPrimitive()) {
                JsonPrimitive jsonPrimitive = subJsonElement.getAsJsonPrimitive();

                if (jsonPrimitive.isBoolean()) {
                    parameter.setType(EndpointTests.EndpointTestParameter.ParameterType.BOOLEAN);
                    parameter.setBoolValue(jsonPrimitive.getAsBoolean());
                } else if (jsonPrimitive.isNumber()) {
                    parameter.setType(EndpointTests.EndpointTestParameter.ParameterType.INTEGER);
                    parameter.setIntValue(jsonPrimitive.getAsInt());
                } else if (jsonPrimitive.isString()) {
                    parameter.setType(EndpointTests.EndpointTestParameter.ParameterType.STRING);
                    parameter.setStrValue(jsonPrimitive.getAsString());
                } else {
                    throw new JsonParseException("Unexpected EndpointTestParameter JSON value");
                }
                retValue.put(parameterName, parameter);
            } else {
                if (parameterName.equals("signingRegionSet") &&
                        subJsonElement.getAsJsonArray().size() == 1 &&
                        subJsonElement.getAsString().equals("*")) {
                    // The set of signing regions to use for this endpoint. Currently,
                    // this will always be ["*"], however this should not be relied upon.
                    parameter.setType(EndpointTests.EndpointTestParameter.ParameterType.STRING);
                    parameter.setStrValue("[\"*\"]");
                } else {
                    throw new JsonParseException("Unexpected EndpointTestParameter JSON value/type, primitive expected.");
                }
            }
        }

        return retValue;

    }
}<commit_msg>Workaround event bridge endpoint test for operation<commit_after>package com.amazonaws.util.awsclientgenerator.domainmodels.endpoints;

import com.google.gson.*;

import java.lang.reflect.Type;
import java.util.Map;

public class EndpointTestParamsDeserializer implements JsonDeserializer<EndpointTests.EndpointTestParams> {

    @Override
    public EndpointTests.EndpointTestParams deserialize(JsonElement jsonElement, Type type,
                                                        JsonDeserializationContext context) throws JsonParseException {
        EndpointTests.EndpointTestParams retValue = new EndpointTests.EndpointTestParams();

        if (!jsonElement.isJsonObject()) {
            throw new JsonParseException("Unexpected params JSON value type, object expected!");
        }

        JsonObject object = jsonElement.getAsJsonObject();

        for(Map.Entry<String, JsonElement> entry : object.entrySet()) {
            String parameterName = entry.getKey();
            JsonElement subJsonElement = entry.getValue();

            EndpointTests.EndpointTestParameter parameter = new EndpointTests.EndpointTestParameter();
            parameter.setName(parameterName);

            if (subJsonElement.isJsonPrimitive()) {
                JsonPrimitive jsonPrimitive = subJsonElement.getAsJsonPrimitive();

                if (jsonPrimitive.isBoolean()) {
                    parameter.setType(EndpointTests.EndpointTestParameter.ParameterType.BOOLEAN);
                    parameter.setBoolValue(jsonPrimitive.getAsBoolean());
                } else if (jsonPrimitive.isNumber()) {
                    parameter.setType(EndpointTests.EndpointTestParameter.ParameterType.INTEGER);
                    parameter.setIntValue(jsonPrimitive.getAsInt());
                } else if (jsonPrimitive.isString()) {
                    parameter.setType(EndpointTests.EndpointTestParameter.ParameterType.STRING);
                    parameter.setStrValue(jsonPrimitive.getAsString());
                } else {
                    throw new JsonParseException("Unexpected EndpointTestParameter JSON value");
                }
                retValue.put(parameterName, parameter);
            } else {
                if (parameterName.equals("signingRegionSet") &&
                        subJsonElement.getAsJsonArray().size() == 1 &&
                        subJsonElement.getAsString().equals("*")) {
                    // The set of signing regions to use for this endpoint. Currently,
                    // this will always be ["*"], however this should not be relied upon.
                    parameter.setType(EndpointTests.EndpointTestParameter.ParameterType.STRING);
                    parameter.setStrValue("[\"*\"]");
                } else {
                    // TODO: follow-up once per-operation tests are enabled
                    // throw new JsonParseException("Unexpected EndpointTestParameter JSON value/type, primitive expected.");
                    // tracing Warning to Error because STDOUT is already occupied for binary forwarding
                    parameter.setType(EndpointTests.EndpointTestParameter.ParameterType.STRING);
                    parameter.setStrValue(subJsonElement.toString());

                    System.err.println("Warning: Unexpected json element while parsing test EndpointParameters: " + parameterName);
                }
            }
        }

        return retValue;

    }
}
{'fraction_non_alphanumeric': 0.08518983369940383, 'fraction_numerical': 0.00031377470975839345, 'mean_word_length': 2.21482602118003, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6039884', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1374, 'n_words': 288}