Exemple #1
0
 internal DeploymentWithOSConfiguration(SapConfigurationType configurationType, AzureLocation?appLocation, InfrastructureConfiguration infrastructureConfiguration, SoftwareConfiguration softwareConfiguration, OSSapConfiguration osSapConfiguration) : base(configurationType)
 {
     AppLocation = appLocation;
     InfrastructureConfiguration = infrastructureConfiguration;
     SoftwareConfiguration       = softwareConfiguration;
     OSSapConfiguration          = osSapConfiguration;
     ConfigurationType           = configurationType;
 }
Exemple #2
0
        internal static DeploymentWithOSConfiguration DeserializeDeploymentWithOSConfiguration(JsonElement element)
        {
            Optional <AzureLocation> appLocation = default;
            Optional <InfrastructureConfiguration> infrastructureConfiguration = default;
            Optional <SoftwareConfiguration>       softwareConfiguration       = default;
            Optional <OSSapConfiguration>          osSapConfiguration          = default;
            SapConfigurationType configurationType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("appLocation"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    appLocation = new AzureLocation(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("infrastructureConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    infrastructureConfiguration = InfrastructureConfiguration.DeserializeInfrastructureConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("softwareConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    softwareConfiguration = SoftwareConfiguration.DeserializeSoftwareConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("osSapConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    osSapConfiguration = OSSapConfiguration.DeserializeOSSapConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("configurationType"))
                {
                    configurationType = new SapConfigurationType(property.Value.GetString());
                    continue;
                }
            }
            return(new DeploymentWithOSConfiguration(configurationType, Optional.ToNullable(appLocation), infrastructureConfiguration.Value, softwareConfiguration.Value, osSapConfiguration.Value));
        }