internal static InfrastructureConfiguration DeserializeInfrastructureConfiguration(JsonElement element) { if (element.TryGetProperty("deploymentType", out JsonElement discriminator)) { switch (discriminator.GetString()) { case "SingleServer": return(SingleServerConfiguration.DeserializeSingleServerConfiguration(element)); case "ThreeTier": return(ThreeTierConfiguration.DeserializeThreeTierConfiguration(element)); } } SapDeploymentType deploymentType = default; string appResourceGroup = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("deploymentType")) { deploymentType = new SapDeploymentType(property.Value.GetString()); continue; } if (property.NameEquals("appResourceGroup")) { appResourceGroup = property.Value.GetString(); continue; } } return(new InfrastructureConfiguration(deploymentType, appResourceGroup)); }
internal static ThreeTierConfiguration DeserializeThreeTierConfiguration(JsonElement element) { Optional <NetworkConfiguration> networkConfiguration = default; CentralServerConfiguration centralServer = default; ApplicationServerConfiguration applicationServer = default; DatabaseConfiguration databaseServer = default; Optional <HighAvailabilityConfiguration> highAvailabilityConfig = 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("centralServer")) { centralServer = CentralServerConfiguration.DeserializeCentralServerConfiguration(property.Value); continue; } if (property.NameEquals("applicationServer")) { applicationServer = ApplicationServerConfiguration.DeserializeApplicationServerConfiguration(property.Value); continue; } if (property.NameEquals("databaseServer")) { databaseServer = DatabaseConfiguration.DeserializeDatabaseConfiguration(property.Value); continue; } if (property.NameEquals("highAvailabilityConfig")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } highAvailabilityConfig = HighAvailabilityConfiguration.DeserializeHighAvailabilityConfiguration(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 ThreeTierConfiguration(deploymentType, appResourceGroup, networkConfiguration.Value, centralServer, applicationServer, databaseServer, highAvailabilityConfig.Value)); }
internal SingleServerConfiguration(SapDeploymentType deploymentType, string appResourceGroup, NetworkConfiguration networkConfiguration, SapDatabaseType?databaseType, ResourceIdentifier subnetId, VirtualMachineConfiguration virtualMachineConfiguration) : base(deploymentType, appResourceGroup) { NetworkConfiguration = networkConfiguration; DatabaseType = databaseType; SubnetId = subnetId; VirtualMachineConfiguration = virtualMachineConfiguration; DeploymentType = deploymentType; }
public SapSupportedSkusContent(AzureLocation appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, SapDatabaseType databaseType) { AppLocation = appLocation; Environment = environment; SapProduct = sapProduct; DeploymentType = deploymentType; DatabaseType = databaseType; }
internal ThreeTierConfiguration(SapDeploymentType deploymentType, string appResourceGroup, NetworkConfiguration networkConfiguration, CentralServerConfiguration centralServer, ApplicationServerConfiguration applicationServer, DatabaseConfiguration databaseServer, HighAvailabilityConfiguration highAvailabilityConfig) : base(deploymentType, appResourceGroup) { NetworkConfiguration = networkConfiguration; CentralServer = centralServer; ApplicationServer = applicationServer; DatabaseServer = databaseServer; HighAvailabilityConfig = highAvailabilityConfig; DeploymentType = deploymentType; }
public SapSizingRecommendationContent(AzureLocation appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, long saps, long dbMemory, SapDatabaseType databaseType) { AppLocation = appLocation; Environment = environment; SapProduct = sapProduct; DeploymentType = deploymentType; Saps = saps; DBMemory = dbMemory; DatabaseType = databaseType; }
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)); }
public SapDiskConfigurationsContent(AzureLocation appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDatabaseType databaseType, SapDeploymentType deploymentType, string dbVmSku) { if (dbVmSku == null) { throw new ArgumentNullException(nameof(dbVmSku)); } AppLocation = appLocation; Environment = environment; SapProduct = sapProduct; DatabaseType = databaseType; DeploymentType = deploymentType; DBVmSku = dbVmSku; }
internal static SingleServerRecommendationResult DeserializeSingleServerRecommendationResult(JsonElement element) { Optional <string> vmSku = default; SapDeploymentType deploymentType = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("vmSku")) { vmSku = property.Value.GetString(); continue; } if (property.NameEquals("deploymentType")) { deploymentType = new SapDeploymentType(property.Value.GetString()); continue; } } return(new SingleServerRecommendationResult(deploymentType, vmSku.Value)); }
internal static SapSizingRecommendationResult DeserializeSapSizingRecommendationResult(JsonElement element) { if (element.TryGetProperty("deploymentType", out JsonElement discriminator)) { switch (discriminator.GetString()) { case "SingleServer": return(SingleServerRecommendationResult.DeserializeSingleServerRecommendationResult(element)); case "ThreeTier": return(ThreeTierRecommendationResult.DeserializeThreeTierRecommendationResult(element)); } } SapDeploymentType deploymentType = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("deploymentType")) { deploymentType = new SapDeploymentType(property.Value.GetString()); continue; } } return(new SapSizingRecommendationResult(deploymentType)); }
internal InfrastructureConfiguration(SapDeploymentType deploymentType, string appResourceGroup) { DeploymentType = deploymentType; AppResourceGroup = appResourceGroup; }
internal static ThreeTierRecommendationResult DeserializeThreeTierRecommendationResult(JsonElement element) { Optional <string> dbVmSku = default; Optional <long> databaseInstanceCount = default; Optional <string> centralServerVmSku = default; Optional <long> centralServerInstanceCount = default; Optional <string> applicationServerVmSku = default; Optional <long> applicationServerInstanceCount = default; SapDeploymentType deploymentType = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("dbVmSku")) { dbVmSku = property.Value.GetString(); continue; } if (property.NameEquals("databaseInstanceCount")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } databaseInstanceCount = property.Value.GetInt64(); continue; } if (property.NameEquals("centralServerVmSku")) { centralServerVmSku = property.Value.GetString(); continue; } if (property.NameEquals("centralServerInstanceCount")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } centralServerInstanceCount = property.Value.GetInt64(); continue; } if (property.NameEquals("applicationServerVmSku")) { applicationServerVmSku = property.Value.GetString(); continue; } if (property.NameEquals("applicationServerInstanceCount")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } applicationServerInstanceCount = property.Value.GetInt64(); continue; } if (property.NameEquals("deploymentType")) { deploymentType = new SapDeploymentType(property.Value.GetString()); continue; } } return(new ThreeTierRecommendationResult(deploymentType, dbVmSku.Value, Optional.ToNullable(databaseInstanceCount), centralServerVmSku.Value, Optional.ToNullable(centralServerInstanceCount), applicationServerVmSku.Value, Optional.ToNullable(applicationServerInstanceCount))); }