private static void ApplyTrafficControlPercentage(ResponseAttributes.Builder builder, JsonObjectValue appConfigObject)
        {
            if (!(appConfigObject[ResponseKeyTrafficControlPercentage] is JsonNumberValue numberValue))
            {
                return;
            }

            builder.WithTrafficControlPercentage(numberValue.IntValue);
        }
        private static void ApplyStatus(ResponseAttributes.Builder builder, JsonObjectValue dynConfigObject)
        {
            if (!(dynConfigObject[ResponseKeyStatus] is JsonStringValue stringValue))
            {
                return;
            }

            builder.WithStatus(stringValue.Value);
        }
        private static void ApplyApplicationId(ResponseAttributes.Builder builder, JsonObjectValue appConfigObject)
        {
            if (!(appConfigObject[ResponseKeyApplicationId] is JsonStringValue stringValue))
            {
                return;
            }

            builder.WithApplicationId(stringValue.Value);
        }
        private static void ApplyMultiplicity(ResponseAttributes.Builder builder, JsonObjectValue dynConfigObject)
        {
            if (!(dynConfigObject[ResponseKeyMultiplicity] is JsonNumberValue numberValue))
            {
                return;
            }

            var multiplicity = numberValue.IntValue;

            builder.WithMultiplicity(multiplicity);
        }
        private static void ApplyDynamicConfiguration(ResponseAttributes.Builder builder, JsonObjectValue rootObject)
        {
            if (!(rootObject[ResponseKeyDynamicConfig] is JsonObjectValue dynConfigObject))
            {
                return;
            }

            ApplyMultiplicity(builder, dynConfigObject);
            ApplyServerId(builder, dynConfigObject);
            ApplyStatus(builder, dynConfigObject);
        }
        private static void ApplyReportErrors(ResponseAttributes.Builder builder, JsonObjectValue appConfigObject)
        {
            if (!(appConfigObject[ResponseKeyReportErrors] is JsonNumberValue numberValue))
            {
                return;
            }

            var reportErrors = numberValue.IntValue;

            builder.WithCaptureErrors(reportErrors != 0);
        }
        private static void ApplyBeaconSizeInKb(ResponseAttributes.Builder builder, JsonObjectValue agentConfigObject)
        {
            if (!(agentConfigObject[ResponseKeyMaxBeaconSizeInKb] is JsonNumberValue numberValue))
            {
                return;
            }

            var beaconSizeInKb = numberValue.IntValue;

            builder.WithMaxBeaconSizeInBytes(beaconSizeInKb * 1024);
        }
        private static void ApplyCapture(ResponseAttributes.Builder builder, JsonObjectValue appConfigObject)
        {
            if (!(appConfigObject[ResponseKeyCapture] is JsonNumberValue numberValue))
            {
                return;
            }

            var capture = numberValue.IntValue;

            builder.WithCapture(capture == 1);
        }
        private static void ApplyRootAttributes(ResponseAttributes.Builder builder, JsonObjectValue rootObject)
        {
            if (!(rootObject[ResponseKeyTimestampInMillis] is JsonNumberValue numberValue))
            {
                return;
            }

            var timestamp = numberValue.LongValue;

            builder.WithTimestampInMilliseconds(timestamp);
        }
        private static void ApplyServerId(ResponseAttributes.Builder builder, JsonObjectValue dynConfigObject)
        {
            if (!(dynConfigObject[ResponseKeyServerId] is JsonNumberValue numberValue))
            {
                return;
            }

            var serverId = numberValue.IntValue;

            builder.WithServerId(serverId);
        }
        private static void ApplyVisitStoreVersion(ResponseAttributes.Builder builder,
                                                   JsonObjectValue agentConfigObject)
        {
            if (!(agentConfigObject[ResponseKeyVisitStoreVersion] is JsonNumberValue numberValue))
            {
                return;
            }

            var visitStoreVersion = numberValue.IntValue;

            builder.WithVisitStoreVersion(visitStoreVersion);
        }
        private static void ApplySendIntervalInSec(ResponseAttributes.Builder builder,
                                                   JsonObjectValue agentConfigObject)
        {
            if (!(agentConfigObject[ResponseKeySendIntervalInSec] is JsonNumberValue numberValue))
            {
                return;
            }

            var intervalInMillis = (int)TimeSpan.FromSeconds(numberValue.IntValue).TotalMilliseconds;

            builder.WithSendIntervalInMilliseconds(intervalInMillis);
        }
        private static void ApplyMaxEventsPerSession(ResponseAttributes.Builder builder,
                                                     JsonObjectValue agentConfigObject)
        {
            if (!(agentConfigObject[ResponseKeyMaxEventsPerSession] is JsonNumberValue numberValue))
            {
                return;
            }

            var maxEvents = numberValue.IntValue;

            builder.WithMaxEventsPerSession(maxEvents);
        }
        private static void ApplySendIntervalInSec(ResponseAttributes.Builder builder,
                                                   Dictionary <string, string> keyValuePairs)
        {
            if (!keyValuePairs.TryGetValue(ResponseKeySendIntervalInSec, out var sendIntervalSecString))
            {
                return;
            }

            var sendIntervalInSec = int.Parse(sendIntervalSecString);

            builder.WithSendIntervalInMilliseconds((int)TimeSpan.FromSeconds(sendIntervalInSec).TotalMilliseconds);
        }
        private static void ApplyBeaconSizeInKb(ResponseAttributes.Builder builder,
                                                Dictionary <string, string> keyValuePairs)
        {
            if (!keyValuePairs.TryGetValue(ResponseKeyMaxBeaconSizeInKb, out var beaconSizeKbString))
            {
                return;
            }

            var beaconSizeInKb = int.Parse(beaconSizeKbString);

            builder.WithMaxBeaconSizeInBytes(beaconSizeInKb * 1024);
        }
        private static void ApplyTrafficControlPercentage(ResponseAttributes.Builder builder,
                                                          Dictionary <string, string> keyValuePairs)
        {
            if (!keyValuePairs.TryGetValue(ResponseKeyTrafficControlPercentage, out var tcValue))
            {
                return;
            }

            var trafficControlPercentage = int.Parse(tcValue);

            builder.WithTrafficControlPercentage(trafficControlPercentage);
        }
        private static void ApplyServerId(ResponseAttributes.Builder builder,
                                          Dictionary <string, string> keyValuePairs)
        {
            if (!keyValuePairs.TryGetValue(ResponseKeyServerId, out var serverIdString))
            {
                return;
            }

            var serverId = int.Parse(serverIdString);

            builder.WithServerId(serverId);
        }
        private static void ApplyMultiplicity(ResponseAttributes.Builder builder,
                                              Dictionary <string, string> keyValuePairs)
        {
            if (!keyValuePairs.TryGetValue(ResponseKeyMultiplicity, out var multiplicityString))
            {
                return;
            }

            var multiplicity = int.Parse(multiplicityString);

            builder.WithMultiplicity(multiplicity);
        }
        private static void ApplyReportErrors(ResponseAttributes.Builder builder,
                                              Dictionary <string, string> keyValuePairs)
        {
            if (!keyValuePairs.TryGetValue(ResponseKeyReportErrors, out var reportErrorsString))
            {
                return;
            }

            var reportErrors = int.Parse(reportErrorsString);

            builder.WithCaptureErrors(reportErrors != 0);
        }
        private static void ApplyCapture(ResponseAttributes.Builder builder,
                                         Dictionary <string, string> keyValuePairs)
        {
            if (!keyValuePairs.TryGetValue(ResponseKeyCapture, out var captureString))
            {
                return;
            }

            var capture = int.Parse(captureString);

            builder.WithCapture(capture == 1);
        }
        private static void ApplyMaxSessionDurationInMin(ResponseAttributes.Builder builder,
                                                         JsonObjectValue agentConfigObject)
        {
            if (!(agentConfigObject[ResponseKeyMaxSessionDurationInMin] is JsonNumberValue numberValue))
            {
                return;
            }

            var sessionDurationMillis = (int)TimeSpan.FromMinutes(numberValue.IntValue).TotalMilliseconds;

            builder.WithMaxSessionDurationInMilliseconds(sessionDurationMillis);
        }
        private static void ApplyApplicationConfiguration(ResponseAttributes.Builder builder,
                                                          JsonObjectValue rootObject)
        {
            if (!(rootObject[ResponseKeyAppConfig] is JsonObjectValue appConfigObject))
            {
                return;
            }

            ApplyCapture(builder, appConfigObject);
            ApplyReportCrashes(builder, appConfigObject);
            ApplyReportErrors(builder, appConfigObject);
            ApplyApplicationId(builder, appConfigObject);
        }
        private static void ApplyAgentConfiguration(ResponseAttributes.Builder builder, JsonObjectValue rootObject)
        {
            if (!(rootObject[ResponseKeyAgentConfig] is JsonObjectValue agentConfigObject))
            {
                return;
            }

            ApplyBeaconSizeInKb(builder, agentConfigObject);
            ApplyMaxSessionDurationInMin(builder, agentConfigObject);
            ApplyMaxEventsPerSession(builder, agentConfigObject);
            ApplySessionTimeoutInSec(builder, agentConfigObject);
            ApplySendIntervalInSec(builder, agentConfigObject);
            ApplyVisitStoreVersion(builder, agentConfigObject);
        }