Esempio n. 1
0
        internal static CentralServerConfiguration DeserializeCentralServerConfiguration(JsonElement element)
        {
            ResourceIdentifier          subnetId = default;
            VirtualMachineConfiguration virtualMachineConfiguration = default;
            long instanceCount = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("subnetId"))
                {
                    subnetId = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("virtualMachineConfiguration"))
                {
                    virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("instanceCount"))
                {
                    instanceCount = property.Value.GetInt64();
                    continue;
                }
            }
            return(new CentralServerConfiguration(subnetId, virtualMachineConfiguration, instanceCount));
        }
Esempio n. 2
0
        internal static SingleServerConfiguration DeserializeSingleServerConfiguration(JsonElement element)
        {
            Optional <NetworkConfiguration> networkConfiguration = default;
            Optional <SapDatabaseType>      databaseType         = default;
            ResourceIdentifier          subnetId = default;
            VirtualMachineConfiguration virtualMachineConfiguration = default;
            SapDeploymentType           deploymentType = default;
            string appResourceGroup = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("networkConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("databaseType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    databaseType = new SapDatabaseType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("subnetId"))
                {
                    subnetId = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("virtualMachineConfiguration"))
                {
                    virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("deploymentType"))
                {
                    deploymentType = new SapDeploymentType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("appResourceGroup"))
                {
                    appResourceGroup = property.Value.GetString();
                    continue;
                }
            }
            return(new SingleServerConfiguration(deploymentType, appResourceGroup, networkConfiguration.Value, Optional.ToNullable(databaseType), subnetId, virtualMachineConfiguration));
        }
Esempio n. 3
0
        internal static DatabaseConfiguration DeserializeDatabaseConfiguration(JsonElement element)
        {
            Optional <SapDatabaseType>  databaseType = default;
            ResourceIdentifier          subnetId     = default;
            VirtualMachineConfiguration virtualMachineConfiguration = default;
            long instanceCount = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("databaseType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    databaseType = new SapDatabaseType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("subnetId"))
                {
                    subnetId = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("virtualMachineConfiguration"))
                {
                    virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("instanceCount"))
                {
                    instanceCount = property.Value.GetInt64();
                    continue;
                }
            }
            return(new DatabaseConfiguration(Optional.ToNullable(databaseType), subnetId, virtualMachineConfiguration, instanceCount));
        }