| 5185 | } |
| 5186 | |
| 5187 | pub async fn provider_profile_lint( |
| 5188 | server: &str, |
| 5189 | file: Option<&Path>, |
| 5190 | from: Option<&Path>, |
| 5191 | tls: &TlsOptions, |
| 5192 | ) -> Result<()> { |
| 5193 | let (items, mut diagnostics) = load_profile_import_items(file, from)?; |
| 5194 | if items.is_empty() && diagnostics.is_empty() { |
| 5195 | return Err(miette!("no provider profile files found")); |
| 5196 | } |
| 5197 | |
| 5198 | if !items.is_empty() { |
| 5199 | let mut client = grpc_client(server, tls).await?; |
| 5200 | let response = client |
| 5201 | .lint_provider_profiles(LintProviderProfilesRequest { profiles: items }) |
| 5202 | .await |
| 5203 | .into_diagnostic()? |
| 5204 | .into_inner(); |
| 5205 | diagnostics.extend(response.diagnostics); |
| 5206 | } |
| 5207 | |
| 5208 | if profile_diagnostics_have_errors(&diagnostics) { |
| 5209 | print_profile_diagnostics(&diagnostics); |
| 5210 | return Err(miette!("provider profile lint failed")); |
| 5211 | } |
| 5212 | |
| 5213 | println!("Provider profile lint passed."); |
| 5214 | Ok(()) |
| 5215 | } |
| 5216 | |
| 5217 | pub async fn provider_profile_delete(server: &str, id: &str, tls: &TlsOptions) -> Result<()> { |
| 5218 | let mut client = grpc_client(server, tls).await?; |