internal static RestorableSqlDatabase DeserializeRestorableSqlDatabase(JsonElement element) { ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <RestorableSqlDatabasePropertiesResource> resource = default; foreach (var property in element.EnumerateObject()) { 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("resource")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } resource = RestorableSqlDatabasePropertiesResource.DeserializeRestorableSqlDatabasePropertiesResource(property0.Value); continue; } } continue; } } return(new RestorableSqlDatabase(id, name, type, systemData, resource.Value)); }
internal RestorableSqlDatabase(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, RestorableSqlDatabasePropertiesResource resource) : base(id, name, type, systemData) { Resource = resource; }