(
items: &[ProviderProfileImportItem],
)
| 1584 | } |
| 1585 | |
| 1586 | fn profiles_from_import_items( |
| 1587 | items: &[ProviderProfileImportItem], |
| 1588 | ) -> ( |
| 1589 | Vec<(String, ProviderTypeProfile)>, |
| 1590 | Vec<ProfileValidationDiagnostic>, |
| 1591 | ) { |
| 1592 | let mut profiles = Vec::new(); |
| 1593 | let mut diagnostics = Vec::new(); |
| 1594 | for item in items { |
| 1595 | let source = item.source.clone(); |
| 1596 | let Some(profile) = item.profile.as_ref() else { |
| 1597 | diagnostics.push(ProfileValidationDiagnostic { |
| 1598 | source, |
| 1599 | profile_id: String::new(), |
| 1600 | field: "profile".to_string(), |
| 1601 | message: "provider profile is required".to_string(), |
| 1602 | severity: "error".to_string(), |
| 1603 | }); |
| 1604 | continue; |
| 1605 | }; |
| 1606 | profiles.push((source, ProviderTypeProfile::from_proto(profile))); |
| 1607 | } |
| 1608 | (profiles, diagnostics) |
| 1609 | } |
| 1610 | |
| 1611 | fn add_empty_profile_set_diagnostic( |
| 1612 | profiles: &[(String, ProviderTypeProfile)], |
no test coverage detected