Ejemplo n.º 1
0
        internal static EnqueueReplicationServerProperties DeserializeEnqueueReplicationServerProperties(JsonElement element)
        {
            Optional <EnqueueReplicationServerType> ersVersion = default;
            Optional <string>         instanceNo    = default;
            Optional <string>         hostname      = default;
            Optional <string>         kernelVersion = default;
            Optional <string>         kernelPatch   = default;
            Optional <string>         ipAddress     = default;
            Optional <SapHealthState> health        = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("ersVersion"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    ersVersion = new EnqueueReplicationServerType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("instanceNo"))
                {
                    instanceNo = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("hostname"))
                {
                    hostname = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("kernelVersion"))
                {
                    kernelVersion = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("kernelPatch"))
                {
                    kernelPatch = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("ipAddress"))
                {
                    ipAddress = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("health"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    health = new SapHealthState(property.Value.GetString());
                    continue;
                }
            }
            return(new EnqueueReplicationServerProperties(Optional.ToNullable(ersVersion), instanceNo.Value, hostname.Value, kernelVersion.Value, kernelPatch.Value, ipAddress.Value, Optional.ToNullable(health)));
        }
Ejemplo n.º 2
0
        internal static GatewayServerProperties DeserializeGatewayServerProperties(JsonElement element)
        {
            Optional <long?>          port   = default;
            Optional <SapHealthState> health = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("port"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        port = null;
                        continue;
                    }
                    port = property.Value.GetInt64();
                    continue;
                }
                if (property.NameEquals("health"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    health = new SapHealthState(property.Value.GetString());
                    continue;
                }
            }
            return(new GatewayServerProperties(Optional.ToNullable(port), Optional.ToNullable(health)));
        }
Ejemplo n.º 3
0
        internal static MessageServerProperties DeserializeMessageServerProperties(JsonElement element)
        {
            Optional <long?>          msPort         = default;
            Optional <long?>          internalMsPort = default;
            Optional <long?>          httpPort       = default;
            Optional <long?>          httpsPort      = default;
            Optional <string>         hostname       = default;
            Optional <string>         ipAddress      = default;
            Optional <SapHealthState> health         = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("msPort"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        msPort = null;
                        continue;
                    }
                    msPort = property.Value.GetInt64();
                    continue;
                }
                if (property.NameEquals("internalMsPort"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        internalMsPort = null;
                        continue;
                    }
                    internalMsPort = property.Value.GetInt64();
                    continue;
                }
                if (property.NameEquals("httpPort"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        httpPort = null;
                        continue;
                    }
                    httpPort = property.Value.GetInt64();
                    continue;
                }
                if (property.NameEquals("httpsPort"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        httpsPort = null;
                        continue;
                    }
                    httpsPort = property.Value.GetInt64();
                    continue;
                }
                if (property.NameEquals("hostname"))
                {
                    hostname = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("ipAddress"))
                {
                    ipAddress = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("health"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    health = new SapHealthState(property.Value.GetString());
                    continue;
                }
            }
            return(new MessageServerProperties(Optional.ToNullable(msPort), Optional.ToNullable(internalMsPort), Optional.ToNullable(httpPort), Optional.ToNullable(httpsPort), hostname.Value, ipAddress.Value, Optional.ToNullable(health)));
        }