internal static SyncGroupData DeserializeSyncGroupData(JsonElement element) { Optional <SqlSku> sku = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <int> interval = default; Optional <DateTimeOffset> lastSyncTime = default; Optional <SyncConflictResolutionPolicy> conflictResolutionPolicy = default; Optional <string> syncDatabaseId = default; Optional <string> hubDatabaseUserName = default; Optional <string> hubDatabasePassword = default; Optional <SyncGroupState> syncState = default; Optional <SyncGroupSchema> schema = default; Optional <bool> enableConflictLogging = default; Optional <int> conflictLoggingRetentionInDays = default; Optional <bool> usePrivateLinkConnection = default; Optional <string> privateEndpointName = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = SqlSku.DeserializeSqlSku(property.Value); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = new ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("interval")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } interval = property0.Value.GetInt32(); continue; } if (property0.NameEquals("lastSyncTime")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } lastSyncTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("conflictResolutionPolicy")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } conflictResolutionPolicy = new SyncConflictResolutionPolicy(property0.Value.GetString()); continue; } if (property0.NameEquals("syncDatabaseId")) { syncDatabaseId = property0.Value.GetString(); continue; } if (property0.NameEquals("hubDatabaseUserName")) { hubDatabaseUserName = property0.Value.GetString(); continue; } if (property0.NameEquals("hubDatabasePassword")) { hubDatabasePassword = property0.Value.GetString(); continue; } if (property0.NameEquals("syncState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } syncState = new SyncGroupState(property0.Value.GetString()); continue; } if (property0.NameEquals("schema")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } schema = SyncGroupSchema.DeserializeSyncGroupSchema(property0.Value); continue; } if (property0.NameEquals("enableConflictLogging")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } enableConflictLogging = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("conflictLoggingRetentionInDays")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } conflictLoggingRetentionInDays = property0.Value.GetInt32(); continue; } if (property0.NameEquals("usePrivateLinkConnection")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } usePrivateLinkConnection = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("privateEndpointName")) { privateEndpointName = property0.Value.GetString(); continue; } } continue; } } return(new SyncGroupData(id, name, type, systemData, sku.Value, Optional.ToNullable(interval), Optional.ToNullable(lastSyncTime), Optional.ToNullable(conflictResolutionPolicy), syncDatabaseId.Value, hubDatabaseUserName.Value, hubDatabasePassword.Value, Optional.ToNullable(syncState), schema.Value, Optional.ToNullable(enableConflictLogging), Optional.ToNullable(conflictLoggingRetentionInDays), Optional.ToNullable(usePrivateLinkConnection), privateEndpointName.Value)); }
internal static ElasticPoolData DeserializeElasticPoolData(JsonElement element) { Optional <SqlSku> sku = default; Optional <string> kind = default; IDictionary <string, string> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <ElasticPoolState> state = default; Optional <DateTimeOffset> creationDate = default; Optional <long> maxSizeBytes = default; Optional <ElasticPoolPerDatabaseSettings> perDatabaseSettings = default; Optional <bool> zoneRedundant = default; Optional <ElasticPoolLicenseType> licenseType = default; Optional <string> maintenanceConfigurationId = default; Optional <int> highAvailabilityReplicaCount = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = SqlSku.DeserializeSqlSku(property.Value); continue; } if (property.NameEquals("kind")) { kind = property.Value.GetString(); continue; } if (property.NameEquals("tags")) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("location")) { location = new AzureLocation(property.Value.GetString()); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = new ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("state")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } state = new ElasticPoolState(property0.Value.GetString()); continue; } if (property0.NameEquals("creationDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } creationDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("maxSizeBytes")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } maxSizeBytes = property0.Value.GetInt64(); continue; } if (property0.NameEquals("perDatabaseSettings")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } perDatabaseSettings = ElasticPoolPerDatabaseSettings.DeserializeElasticPoolPerDatabaseSettings(property0.Value); continue; } if (property0.NameEquals("zoneRedundant")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } zoneRedundant = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("licenseType")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } licenseType = new ElasticPoolLicenseType(property0.Value.GetString()); continue; } if (property0.NameEquals("maintenanceConfigurationId")) { maintenanceConfigurationId = property0.Value.GetString(); continue; } if (property0.NameEquals("highAvailabilityReplicaCount")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } highAvailabilityReplicaCount = property0.Value.GetInt32(); continue; } } continue; } } return(new ElasticPoolData(id, name, type, systemData, tags, location, sku.Value, kind.Value, Optional.ToNullable(state), Optional.ToNullable(creationDate), Optional.ToNullable(maxSizeBytes), perDatabaseSettings.Value, Optional.ToNullable(zoneRedundant), Optional.ToNullable(licenseType), maintenanceConfigurationId.Value, Optional.ToNullable(highAvailabilityReplicaCount))); }
internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement element) { Optional <ManagedServiceIdentity> identity = default; Optional <SqlSku> sku = default; IDictionary <string, string> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <ManagedInstancePropertiesProvisioningState> provisioningState = default; Optional <ManagedServerCreateMode> managedInstanceCreateMode = default; Optional <string> fullyQualifiedDomainName = default; Optional <string> administratorLogin = default; Optional <string> administratorLoginPassword = default; Optional <string> subnetId = default; Optional <string> state = default; Optional <ManagedInstanceLicenseType> licenseType = default; Optional <int> vCores = default; Optional <int> storageSizeInGB = default; Optional <string> collation = default; Optional <string> dnsZone = default; Optional <string> dnsZonePartner = default; Optional <bool> publicDataEndpointEnabled = default; Optional <string> sourceManagedInstanceId = default; Optional <DateTimeOffset> restorePointInTime = default; Optional <ManagedInstanceProxyOverride> proxyOverride = default; Optional <string> timezoneId = default; Optional <string> instancePoolId = default; Optional <string> maintenanceConfigurationId = default; Optional <IReadOnlyList <ManagedInstancePecProperty> > privateEndpointConnections = default; Optional <string> minimalTlsVersion = default; Optional <StorageAccountType> storageAccountType = default; Optional <bool> zoneRedundant = default; Optional <string> primaryUserAssignedIdentityId = default; Optional <string> keyId = default; Optional <ManagedInstanceExternalAdministrator> administrators = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("identity")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; identity = JsonSerializer.Deserialize <ManagedServiceIdentity>(property.Value.ToString(), serializeOptions); continue; } if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = SqlSku.DeserializeSqlSku(property.Value); continue; } if (property.NameEquals("tags")) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("location")) { location = property.Value.GetString(); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = new ManagedInstancePropertiesProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("managedInstanceCreateMode")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } managedInstanceCreateMode = new ManagedServerCreateMode(property0.Value.GetString()); continue; } if (property0.NameEquals("fullyQualifiedDomainName")) { fullyQualifiedDomainName = property0.Value.GetString(); continue; } if (property0.NameEquals("administratorLogin")) { administratorLogin = property0.Value.GetString(); continue; } if (property0.NameEquals("administratorLoginPassword")) { administratorLoginPassword = property0.Value.GetString(); continue; } if (property0.NameEquals("subnetId")) { subnetId = property0.Value.GetString(); continue; } if (property0.NameEquals("state")) { state = property0.Value.GetString(); continue; } if (property0.NameEquals("licenseType")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } licenseType = new ManagedInstanceLicenseType(property0.Value.GetString()); continue; } if (property0.NameEquals("vCores")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } vCores = property0.Value.GetInt32(); continue; } if (property0.NameEquals("storageSizeInGB")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } storageSizeInGB = property0.Value.GetInt32(); continue; } if (property0.NameEquals("collation")) { collation = property0.Value.GetString(); continue; } if (property0.NameEquals("dnsZone")) { dnsZone = property0.Value.GetString(); continue; } if (property0.NameEquals("dnsZonePartner")) { dnsZonePartner = property0.Value.GetString(); continue; } if (property0.NameEquals("publicDataEndpointEnabled")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } publicDataEndpointEnabled = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("sourceManagedInstanceId")) { sourceManagedInstanceId = property0.Value.GetString(); continue; } if (property0.NameEquals("restorePointInTime")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } restorePointInTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("proxyOverride")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } proxyOverride = new ManagedInstanceProxyOverride(property0.Value.GetString()); continue; } if (property0.NameEquals("timezoneId")) { timezoneId = property0.Value.GetString(); continue; } if (property0.NameEquals("instancePoolId")) { instancePoolId = property0.Value.GetString(); continue; } if (property0.NameEquals("maintenanceConfigurationId")) { maintenanceConfigurationId = property0.Value.GetString(); continue; } if (property0.NameEquals("privateEndpointConnections")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } List <ManagedInstancePecProperty> array = new List <ManagedInstancePecProperty>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(ManagedInstancePecProperty.DeserializeManagedInstancePecProperty(item)); } privateEndpointConnections = array; continue; } if (property0.NameEquals("minimalTlsVersion")) { minimalTlsVersion = property0.Value.GetString(); continue; } if (property0.NameEquals("storageAccountType")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } storageAccountType = new StorageAccountType(property0.Value.GetString()); continue; } if (property0.NameEquals("zoneRedundant")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } zoneRedundant = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("primaryUserAssignedIdentityId")) { primaryUserAssignedIdentityId = property0.Value.GetString(); continue; } if (property0.NameEquals("keyId")) { keyId = property0.Value.GetString(); continue; } if (property0.NameEquals("administrators")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } administrators = ManagedInstanceExternalAdministrator.DeserializeManagedInstanceExternalAdministrator(property0.Value); continue; } } continue; } } return(new ManagedInstanceData(id, name, type, systemData, tags, location, identity, sku.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(managedInstanceCreateMode), fullyQualifiedDomainName.Value, administratorLogin.Value, administratorLoginPassword.Value, subnetId.Value, state.Value, Optional.ToNullable(licenseType), Optional.ToNullable(vCores), Optional.ToNullable(storageSizeInGB), collation.Value, dnsZone.Value, dnsZonePartner.Value, Optional.ToNullable(publicDataEndpointEnabled), sourceManagedInstanceId.Value, Optional.ToNullable(restorePointInTime), Optional.ToNullable(proxyOverride), timezoneId.Value, instancePoolId.Value, maintenanceConfigurationId.Value, Optional.ToList(privateEndpointConnections), minimalTlsVersion.Value, Optional.ToNullable(storageAccountType), Optional.ToNullable(zoneRedundant), primaryUserAssignedIdentityId.Value, keyId.Value, administrators.Value)); }
internal static JobAgentData DeserializeJobAgentData(JsonElement element) { Optional <SqlSku> sku = default; IDictionary <string, string> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <string> databaseId = default; Optional <JobAgentState> state = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = SqlSku.DeserializeSqlSku(property.Value); continue; } if (property.NameEquals("tags")) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("location")) { location = new AzureLocation(property.Value.GetString()); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = new ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("databaseId")) { databaseId = property0.Value.GetString(); continue; } if (property0.NameEquals("state")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } state = new JobAgentState(property0.Value.GetString()); continue; } } continue; } } return(new JobAgentData(id, name, type, systemData, tags, location, sku.Value, databaseId.Value, Optional.ToNullable(state))); }
internal static InstancePoolData DeserializeInstancePoolData(JsonElement element) { Optional <SqlSku> sku = default; IDictionary <string, string> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <string> subnetId = default; Optional <int> vCores = default; Optional <InstancePoolLicenseType> licenseType = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = SqlSku.DeserializeSqlSku(property.Value); continue; } if (property.NameEquals("tags")) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("location")) { location = property.Value.GetString(); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("subnetId")) { subnetId = property0.Value.GetString(); continue; } if (property0.NameEquals("vCores")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } vCores = property0.Value.GetInt32(); continue; } if (property0.NameEquals("licenseType")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } licenseType = new InstancePoolLicenseType(property0.Value.GetString()); continue; } } continue; } } return(new InstancePoolData(id, name, type, systemData, tags, location, sku.Value, subnetId.Value, Optional.ToNullable(vCores), Optional.ToNullable(licenseType))); }
internal static RestorableDroppedDatabaseData DeserializeRestorableDroppedDatabaseData(JsonElement element) { Optional <SqlSku> sku = default; Optional <string> location = default; Optional <IDictionary <string, string> > tags = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <string> databaseName = default; Optional <long> maxSizeBytes = default; Optional <string> elasticPoolId = default; Optional <DateTimeOffset> creationDate = default; Optional <DateTimeOffset> deletionDate = default; Optional <DateTimeOffset> earliestRestoreDate = default; Optional <RestorableDroppedDatabasePropertiesBackupStorageRedundancy> backupStorageRedundancy = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = SqlSku.DeserializeSqlSku(property.Value); continue; } if (property.NameEquals("location")) { location = property.Value.GetString(); continue; } if (property.NameEquals("tags")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("databaseName")) { databaseName = property0.Value.GetString(); continue; } if (property0.NameEquals("maxSizeBytes")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } maxSizeBytes = property0.Value.GetInt64(); continue; } if (property0.NameEquals("elasticPoolId")) { elasticPoolId = property0.Value.GetString(); continue; } if (property0.NameEquals("creationDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } creationDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("deletionDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } deletionDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("earliestRestoreDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } earliestRestoreDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("backupStorageRedundancy")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } backupStorageRedundancy = new RestorableDroppedDatabasePropertiesBackupStorageRedundancy(property0.Value.GetString()); continue; } } continue; } } return(new RestorableDroppedDatabaseData(id, name, type, systemData, sku.Value, location.Value, Optional.ToDictionary(tags), databaseName.Value, Optional.ToNullable(maxSizeBytes), elasticPoolId.Value, Optional.ToNullable(creationDate), Optional.ToNullable(deletionDate), Optional.ToNullable(earliestRestoreDate), Optional.ToNullable(backupStorageRedundancy))); }
internal static SqlDatabaseData DeserializeSqlDatabaseData(JsonElement element) { Optional <SqlSku> sku = default; Optional <string> kind = default; Optional <string> managedBy = default; Optional <DatabaseIdentity> identity = default; IDictionary <string, string> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <CreateMode> createMode = default; Optional <string> collation = default; Optional <long> maxSizeBytes = default; Optional <SampleSchemaName> sampleName = default; Optional <string> elasticPoolId = default; Optional <string> sourceDatabaseId = default; Optional <DatabaseStatus> status = default; Optional <Guid> databaseId = default; Optional <DateTimeOffset> creationDate = default; Optional <string> currentServiceObjectiveName = default; Optional <string> requestedServiceObjectiveName = default; Optional <string> defaultSecondaryLocation = default; Optional <string> failoverGroupId = default; Optional <DateTimeOffset> restorePointInTime = default; Optional <DateTimeOffset> sourceDatabaseDeletionDate = default; Optional <string> recoveryServicesRecoveryPointId = default; Optional <string> longTermRetentionBackupResourceId = default; Optional <string> recoverableDatabaseId = default; Optional <string> restorableDroppedDatabaseId = default; Optional <CatalogCollationType> catalogCollation = default; Optional <bool> zoneRedundant = default; Optional <DatabaseLicenseType> licenseType = default; Optional <long> maxLogSizeBytes = default; Optional <DateTimeOffset> earliestRestoreDate = default; Optional <DatabaseReadScale> readScale = default; Optional <int> highAvailabilityReplicaCount = default; Optional <SecondaryType> secondaryType = default; Optional <SqlSku> currentSku = default; Optional <int> autoPauseDelay = default; Optional <BackupStorageRedundancy> currentBackupStorageRedundancy = default; Optional <BackupStorageRedundancy> requestedBackupStorageRedundancy = default; Optional <double> minCapacity = default; Optional <DateTimeOffset> pausedDate = default; Optional <DateTimeOffset> resumedDate = default; Optional <string> maintenanceConfigurationId = default; Optional <bool> isLedgerOn = default; Optional <bool> isInfraEncryptionEnabled = default; Optional <Guid> federatedClientId = default; Optional <string> sourceResourceId = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = SqlSku.DeserializeSqlSku(property.Value); continue; } if (property.NameEquals("kind")) { kind = property.Value.GetString(); continue; } if (property.NameEquals("managedBy")) { managedBy = property.Value.GetString(); continue; } if (property.NameEquals("identity")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } identity = DatabaseIdentity.DeserializeDatabaseIdentity(property.Value); continue; } if (property.NameEquals("tags")) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("location")) { location = new AzureLocation(property.Value.GetString()); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = new ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("createMode")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } createMode = new CreateMode(property0.Value.GetString()); continue; } if (property0.NameEquals("collation")) { collation = property0.Value.GetString(); continue; } if (property0.NameEquals("maxSizeBytes")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } maxSizeBytes = property0.Value.GetInt64(); continue; } if (property0.NameEquals("sampleName")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } sampleName = new SampleSchemaName(property0.Value.GetString()); continue; } if (property0.NameEquals("elasticPoolId")) { elasticPoolId = property0.Value.GetString(); continue; } if (property0.NameEquals("sourceDatabaseId")) { sourceDatabaseId = property0.Value.GetString(); continue; } if (property0.NameEquals("status")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } status = new DatabaseStatus(property0.Value.GetString()); continue; } if (property0.NameEquals("databaseId")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } databaseId = property0.Value.GetGuid(); continue; } if (property0.NameEquals("creationDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } creationDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("currentServiceObjectiveName")) { currentServiceObjectiveName = property0.Value.GetString(); continue; } if (property0.NameEquals("requestedServiceObjectiveName")) { requestedServiceObjectiveName = property0.Value.GetString(); continue; } if (property0.NameEquals("defaultSecondaryLocation")) { defaultSecondaryLocation = property0.Value.GetString(); continue; } if (property0.NameEquals("failoverGroupId")) { failoverGroupId = property0.Value.GetString(); continue; } if (property0.NameEquals("restorePointInTime")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } restorePointInTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("sourceDatabaseDeletionDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } sourceDatabaseDeletionDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("recoveryServicesRecoveryPointId")) { recoveryServicesRecoveryPointId = property0.Value.GetString(); continue; } if (property0.NameEquals("longTermRetentionBackupResourceId")) { longTermRetentionBackupResourceId = property0.Value.GetString(); continue; } if (property0.NameEquals("recoverableDatabaseId")) { recoverableDatabaseId = property0.Value.GetString(); continue; } if (property0.NameEquals("restorableDroppedDatabaseId")) { restorableDroppedDatabaseId = property0.Value.GetString(); continue; } if (property0.NameEquals("catalogCollation")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } catalogCollation = new CatalogCollationType(property0.Value.GetString()); continue; } if (property0.NameEquals("zoneRedundant")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } zoneRedundant = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("licenseType")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } licenseType = new DatabaseLicenseType(property0.Value.GetString()); continue; } if (property0.NameEquals("maxLogSizeBytes")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } maxLogSizeBytes = property0.Value.GetInt64(); continue; } if (property0.NameEquals("earliestRestoreDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } earliestRestoreDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("readScale")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } readScale = new DatabaseReadScale(property0.Value.GetString()); continue; } if (property0.NameEquals("highAvailabilityReplicaCount")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } highAvailabilityReplicaCount = property0.Value.GetInt32(); continue; } if (property0.NameEquals("secondaryType")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } secondaryType = new SecondaryType(property0.Value.GetString()); continue; } if (property0.NameEquals("currentSku")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } currentSku = SqlSku.DeserializeSqlSku(property0.Value); continue; } if (property0.NameEquals("autoPauseDelay")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } autoPauseDelay = property0.Value.GetInt32(); continue; } if (property0.NameEquals("currentBackupStorageRedundancy")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } currentBackupStorageRedundancy = new BackupStorageRedundancy(property0.Value.GetString()); continue; } if (property0.NameEquals("requestedBackupStorageRedundancy")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } requestedBackupStorageRedundancy = new BackupStorageRedundancy(property0.Value.GetString()); continue; } if (property0.NameEquals("minCapacity")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } minCapacity = property0.Value.GetDouble(); continue; } if (property0.NameEquals("pausedDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } pausedDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("resumedDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } resumedDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("maintenanceConfigurationId")) { maintenanceConfigurationId = property0.Value.GetString(); continue; } if (property0.NameEquals("isLedgerOn")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } isLedgerOn = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("isInfraEncryptionEnabled")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } isInfraEncryptionEnabled = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("federatedClientId")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } federatedClientId = property0.Value.GetGuid(); continue; } if (property0.NameEquals("sourceResourceId")) { sourceResourceId = property0.Value.GetString(); continue; } } continue; } } return(new SqlDatabaseData(id, name, type, systemData, tags, location, sku.Value, kind.Value, managedBy.Value, identity.Value, Optional.ToNullable(createMode), collation.Value, Optional.ToNullable(maxSizeBytes), Optional.ToNullable(sampleName), elasticPoolId.Value, sourceDatabaseId.Value, Optional.ToNullable(status), Optional.ToNullable(databaseId), Optional.ToNullable(creationDate), currentServiceObjectiveName.Value, requestedServiceObjectiveName.Value, defaultSecondaryLocation.Value, failoverGroupId.Value, Optional.ToNullable(restorePointInTime), Optional.ToNullable(sourceDatabaseDeletionDate), recoveryServicesRecoveryPointId.Value, longTermRetentionBackupResourceId.Value, recoverableDatabaseId.Value, restorableDroppedDatabaseId.Value, Optional.ToNullable(catalogCollation), Optional.ToNullable(zoneRedundant), Optional.ToNullable(licenseType), Optional.ToNullable(maxLogSizeBytes), Optional.ToNullable(earliestRestoreDate), Optional.ToNullable(readScale), Optional.ToNullable(highAvailabilityReplicaCount), Optional.ToNullable(secondaryType), currentSku.Value, Optional.ToNullable(autoPauseDelay), Optional.ToNullable(currentBackupStorageRedundancy), Optional.ToNullable(requestedBackupStorageRedundancy), Optional.ToNullable(minCapacity), Optional.ToNullable(pausedDate), Optional.ToNullable(resumedDate), maintenanceConfigurationId.Value, Optional.ToNullable(isLedgerOn), Optional.ToNullable(isInfraEncryptionEnabled), Optional.ToNullable(federatedClientId), sourceResourceId.Value)); }