internal ManagedInstanceVcoresCapability(string name, int?value, MaxSizeCapability includedMaxSize, IReadOnlyList <MaxSizeRangeCapability> supportedStorageSizes, bool?instancePoolSupported, bool?standaloneSupported, CapabilityStatus?status, string reason)
 {
     Name                  = name;
     Value                 = value;
     IncludedMaxSize       = includedMaxSize;
     SupportedStorageSizes = supportedStorageSizes;
     InstancePoolSupported = instancePoolSupported;
     StandaloneSupported   = standaloneSupported;
     Status                = status;
     Reason                = reason;
 }
Beispiel #2
0
        internal static InstancePoolVcoresCapability DeserializeInstancePoolVcoresCapability(JsonElement element)
        {
            Optional <string>            name         = default;
            Optional <int>               value        = default;
            Optional <MaxSizeCapability> storageLimit = default;
            Optional <CapabilityStatus>  status       = default;
            Optional <string>            reason       = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    value = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("storageLimit"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    storageLimit = MaxSizeCapability.DeserializeMaxSizeCapability(property.Value);
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    status = property.Value.GetString().ToCapabilityStatus();
                    continue;
                }
                if (property.NameEquals("reason"))
                {
                    reason = property.Value.GetString();
                    continue;
                }
            }
            return(new InstancePoolVcoresCapability(name.Value, Optional.ToNullable(value), storageLimit.Value, Optional.ToNullable(status), reason.Value));
        }
 internal ElasticPoolPerformanceLevelCapability(PerformanceLevelCapability performanceLevel, Sku sku, IReadOnlyList <LicenseTypeCapability> supportedLicenseTypes, int?maxDatabaseCount, MaxSizeCapability includedMaxSize, IReadOnlyList <MaxSizeRangeCapability> supportedMaxSizes, IReadOnlyList <MaxSizeRangeCapability> supportedPerDatabaseMaxSizes, IReadOnlyList <ElasticPoolPerDatabaseMaxPerformanceLevelCapability> supportedPerDatabaseMaxPerformanceLevels, bool?zoneRedundant, CapabilityStatus?status, string reason)
 {
     PerformanceLevel = performanceLevel;
     Sku = sku;
     SupportedLicenseTypes                    = supportedLicenseTypes;
     MaxDatabaseCount                         = maxDatabaseCount;
     IncludedMaxSize                          = includedMaxSize;
     SupportedMaxSizes                        = supportedMaxSizes;
     SupportedPerDatabaseMaxSizes             = supportedPerDatabaseMaxSizes;
     SupportedPerDatabaseMaxPerformanceLevels = supportedPerDatabaseMaxPerformanceLevels;
     ZoneRedundant = zoneRedundant;
     Status        = status;
     Reason        = reason;
 }
Beispiel #4
0
 internal ServiceObjectiveCapability(Guid?id, string name, IReadOnlyList <MaxSizeRangeCapability> supportedMaxSizes, PerformanceLevelCapability performanceLevel, Sku sku, IReadOnlyList <LicenseTypeCapability> supportedLicenseTypes, MaxSizeCapability includedMaxSize, bool?zoneRedundant, AutoPauseDelayTimeRange supportedAutoPauseDelay, IReadOnlyList <MinCapacityCapability> supportedMinCapacities, string computeModel, CapabilityStatus?status, string reason)
 {
     Id   = id;
     Name = name;
     SupportedMaxSizes = supportedMaxSizes;
     PerformanceLevel  = performanceLevel;
     Sku = sku;
     SupportedLicenseTypes   = supportedLicenseTypes;
     IncludedMaxSize         = includedMaxSize;
     ZoneRedundant           = zoneRedundant;
     SupportedAutoPauseDelay = supportedAutoPauseDelay;
     SupportedMinCapacities  = supportedMinCapacities;
     ComputeModel            = computeModel;
     Status = status;
     Reason = reason;
 }
Beispiel #5
0
        internal static MaxSizeRangeCapability DeserializeMaxSizeRangeCapability(JsonElement element)
        {
            Optional <MaxSizeCapability> minValue  = default;
            Optional <MaxSizeCapability> maxValue  = default;
            Optional <MaxSizeCapability> scaleSize = default;
            Optional <LogSizeCapability> logSize   = default;
            Optional <CapabilityStatus>  status    = default;
            Optional <string>            reason    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("minValue"))
                {
                    minValue = MaxSizeCapability.DeserializeMaxSizeCapability(property.Value);
                    continue;
                }
                if (property.NameEquals("maxValue"))
                {
                    maxValue = MaxSizeCapability.DeserializeMaxSizeCapability(property.Value);
                    continue;
                }
                if (property.NameEquals("scaleSize"))
                {
                    scaleSize = MaxSizeCapability.DeserializeMaxSizeCapability(property.Value);
                    continue;
                }
                if (property.NameEquals("logSize"))
                {
                    logSize = LogSizeCapability.DeserializeLogSizeCapability(property.Value);
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    status = property.Value.GetString().ToCapabilityStatus();
                    continue;
                }
                if (property.NameEquals("reason"))
                {
                    reason = property.Value.GetString();
                    continue;
                }
            }
            return(new MaxSizeRangeCapability(minValue.Value, maxValue.Value, scaleSize.Value, logSize.Value, Optional.ToNullable(status), reason.Value));
        }
Beispiel #6
0
        internal static ServiceObjectiveCapability DeserializeServiceObjectiveCapability(JsonElement element)
        {
            Optional <Guid>   id   = default;
            Optional <string> name = default;
            Optional <IReadOnlyList <MaxSizeRangeCapability> > supportedMaxSizes = default;
            Optional <PerformanceLevelCapability> performanceLevel = default;
            Optional <Sku> sku = default;
            Optional <IReadOnlyList <LicenseTypeCapability> > supportedLicenseTypes = default;
            Optional <MaxSizeCapability> includedMaxSize = default;
            Optional <bool> zoneRedundant = default;
            Optional <AutoPauseDelayTimeRange> supportedAutoPauseDelay = default;
            Optional <IReadOnlyList <MinCapacityCapability> > supportedMinCapacities = default;
            Optional <string> computeModel = default;
            Optional <IReadOnlyList <MaintenanceConfigurationCapability> > supportedMaintenanceConfigurations = default;
            Optional <CapabilityStatus> status = default;
            Optional <string>           reason = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    id = property.Value.GetGuid();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("supportedMaxSizes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <MaxSizeRangeCapability> array = new List <MaxSizeRangeCapability>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MaxSizeRangeCapability.DeserializeMaxSizeRangeCapability(item));
                    }
                    supportedMaxSizes = array;
                    continue;
                }
                if (property.NameEquals("performanceLevel"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    performanceLevel = PerformanceLevelCapability.DeserializePerformanceLevelCapability(property.Value);
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = Sku.DeserializeSku(property.Value);
                    continue;
                }
                if (property.NameEquals("supportedLicenseTypes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <LicenseTypeCapability> array = new List <LicenseTypeCapability>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(LicenseTypeCapability.DeserializeLicenseTypeCapability(item));
                    }
                    supportedLicenseTypes = array;
                    continue;
                }
                if (property.NameEquals("includedMaxSize"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    includedMaxSize = MaxSizeCapability.DeserializeMaxSizeCapability(property.Value);
                    continue;
                }
                if (property.NameEquals("zoneRedundant"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    zoneRedundant = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("supportedAutoPauseDelay"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    supportedAutoPauseDelay = AutoPauseDelayTimeRange.DeserializeAutoPauseDelayTimeRange(property.Value);
                    continue;
                }
                if (property.NameEquals("supportedMinCapacities"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <MinCapacityCapability> array = new List <MinCapacityCapability>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MinCapacityCapability.DeserializeMinCapacityCapability(item));
                    }
                    supportedMinCapacities = array;
                    continue;
                }
                if (property.NameEquals("computeModel"))
                {
                    computeModel = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("supportedMaintenanceConfigurations"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <MaintenanceConfigurationCapability> array = new List <MaintenanceConfigurationCapability>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MaintenanceConfigurationCapability.DeserializeMaintenanceConfigurationCapability(item));
                    }
                    supportedMaintenanceConfigurations = array;
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    status = property.Value.GetString().ToCapabilityStatus();
                    continue;
                }
                if (property.NameEquals("reason"))
                {
                    reason = property.Value.GetString();
                    continue;
                }
            }
            return(new ServiceObjectiveCapability(Optional.ToNullable(id), name.Value, Optional.ToList(supportedMaxSizes), performanceLevel.Value, sku.Value, Optional.ToList(supportedLicenseTypes), includedMaxSize.Value, Optional.ToNullable(zoneRedundant), supportedAutoPauseDelay.Value, Optional.ToList(supportedMinCapacities), computeModel.Value, Optional.ToList(supportedMaintenanceConfigurations), Optional.ToNullable(status), reason.Value));
        }
        internal static ElasticPoolPerformanceLevelCapability DeserializeElasticPoolPerformanceLevelCapability(JsonElement element)
        {
            Optional <PerformanceLevelCapability> performanceLevel = default;
            Optional <Sku> sku = default;
            Optional <IReadOnlyList <LicenseTypeCapability> > supportedLicenseTypes = default;
            Optional <int> maxDatabaseCount = default;
            Optional <MaxSizeCapability> includedMaxSize = default;
            Optional <IReadOnlyList <MaxSizeRangeCapability> > supportedMaxSizes            = default;
            Optional <IReadOnlyList <MaxSizeRangeCapability> > supportedPerDatabaseMaxSizes = default;
            Optional <IReadOnlyList <ElasticPoolPerDatabaseMaxPerformanceLevelCapability> > supportedPerDatabaseMaxPerformanceLevels = default;
            Optional <bool>             zoneRedundant = default;
            Optional <CapabilityStatus> status        = default;
            Optional <string>           reason        = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("performanceLevel"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    performanceLevel = PerformanceLevelCapability.DeserializePerformanceLevelCapability(property.Value);
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = Sku.DeserializeSku(property.Value);
                    continue;
                }
                if (property.NameEquals("supportedLicenseTypes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <LicenseTypeCapability> array = new List <LicenseTypeCapability>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(LicenseTypeCapability.DeserializeLicenseTypeCapability(item));
                    }
                    supportedLicenseTypes = array;
                    continue;
                }
                if (property.NameEquals("maxDatabaseCount"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    maxDatabaseCount = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("includedMaxSize"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    includedMaxSize = MaxSizeCapability.DeserializeMaxSizeCapability(property.Value);
                    continue;
                }
                if (property.NameEquals("supportedMaxSizes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <MaxSizeRangeCapability> array = new List <MaxSizeRangeCapability>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MaxSizeRangeCapability.DeserializeMaxSizeRangeCapability(item));
                    }
                    supportedMaxSizes = array;
                    continue;
                }
                if (property.NameEquals("supportedPerDatabaseMaxSizes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <MaxSizeRangeCapability> array = new List <MaxSizeRangeCapability>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MaxSizeRangeCapability.DeserializeMaxSizeRangeCapability(item));
                    }
                    supportedPerDatabaseMaxSizes = array;
                    continue;
                }
                if (property.NameEquals("supportedPerDatabaseMaxPerformanceLevels"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <ElasticPoolPerDatabaseMaxPerformanceLevelCapability> array = new List <ElasticPoolPerDatabaseMaxPerformanceLevelCapability>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ElasticPoolPerDatabaseMaxPerformanceLevelCapability.DeserializeElasticPoolPerDatabaseMaxPerformanceLevelCapability(item));
                    }
                    supportedPerDatabaseMaxPerformanceLevels = array;
                    continue;
                }
                if (property.NameEquals("zoneRedundant"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    zoneRedundant = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    status = property.Value.GetString().ToCapabilityStatus();
                    continue;
                }
                if (property.NameEquals("reason"))
                {
                    reason = property.Value.GetString();
                    continue;
                }
            }
            return(new ElasticPoolPerformanceLevelCapability(performanceLevel.Value, sku.Value, Optional.ToList(supportedLicenseTypes), Optional.ToNullable(maxDatabaseCount), includedMaxSize.Value, Optional.ToList(supportedMaxSizes), Optional.ToList(supportedPerDatabaseMaxSizes), Optional.ToList(supportedPerDatabaseMaxPerformanceLevels), Optional.ToNullable(zoneRedundant), Optional.ToNullable(status), reason.Value));
        }
Beispiel #8
0
        internal static ManagedInstanceVcoresCapability DeserializeManagedInstanceVcoresCapability(JsonElement element)
        {
            Optional <string>            name            = default;
            Optional <int>               value           = default;
            Optional <MaxSizeCapability> includedMaxSize = default;
            Optional <IReadOnlyList <MaxSizeRangeCapability> > supportedStorageSizes = default;
            Optional <bool> instancePoolSupported = default;
            Optional <bool> standaloneSupported   = default;
            Optional <IReadOnlyList <ManagedInstanceMaintenanceConfigurationCapability> > supportedMaintenanceConfigurations = default;
            Optional <CapabilityStatus> status = default;
            Optional <string>           reason = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    value = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("includedMaxSize"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    includedMaxSize = MaxSizeCapability.DeserializeMaxSizeCapability(property.Value);
                    continue;
                }
                if (property.NameEquals("supportedStorageSizes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <MaxSizeRangeCapability> array = new List <MaxSizeRangeCapability>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MaxSizeRangeCapability.DeserializeMaxSizeRangeCapability(item));
                    }
                    supportedStorageSizes = array;
                    continue;
                }
                if (property.NameEquals("instancePoolSupported"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    instancePoolSupported = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("standaloneSupported"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    standaloneSupported = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("supportedMaintenanceConfigurations"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <ManagedInstanceMaintenanceConfigurationCapability> array = new List <ManagedInstanceMaintenanceConfigurationCapability>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ManagedInstanceMaintenanceConfigurationCapability.DeserializeManagedInstanceMaintenanceConfigurationCapability(item));
                    }
                    supportedMaintenanceConfigurations = array;
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    status = property.Value.GetString().ToCapabilityStatus();
                    continue;
                }
                if (property.NameEquals("reason"))
                {
                    reason = property.Value.GetString();
                    continue;
                }
            }
            return(new ManagedInstanceVcoresCapability(name.Value, Optional.ToNullable(value), includedMaxSize.Value, Optional.ToList(supportedStorageSizes), Optional.ToNullable(instancePoolSupported), Optional.ToNullable(standaloneSupported), Optional.ToList(supportedMaintenanceConfigurations), Optional.ToNullable(status), reason.Value));
        }