MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / get_blynk_integration

Method get_blynk_integration

chirpstack/src/api/application.rs:1696–1728  ·  view source on GitHub ↗
(
        &self,
        request: Request<api::GetBlynkIntegrationRequest>,
    )

Source from the content-addressed store, hash-verified

1694 }
1695
1696 async fn get_blynk_integration(
1697 &self,
1698 request: Request<api::GetBlynkIntegrationRequest>,
1699 ) -> Result<Response<api::GetBlynkIntegrationResponse>, Status> {
1700 let req = request.get_ref();
1701 let app_id = Uuid::from_str(&req.application_id).map_err(|e| e.status())?;
1702
1703 self.validator
1704 .validate(
1705 request.extensions(),
1706 validator::ValidateApplicationAccess::new(validator::Flag::Read, app_id),
1707 )
1708 .await?;
1709
1710 let i = application::get_integration(&app_id, application::IntegrationKind::Blynk)
1711 .await
1712 .map_err(|e| e.status())?;
1713
1714 if let application::IntegrationConfiguration::Blynk(conf) = &i.configuration {
1715 let mut resp = Response::new(api::GetBlynkIntegrationResponse {
1716 integration: Some(api::BlynkIntegration {
1717 application_id: app_id.to_string(),
1718 token: conf.token.clone(),
1719 }),
1720 });
1721 resp.metadata_mut()
1722 .insert("x-log-application_id", req.application_id.parse().unwrap());
1723
1724 Ok(resp)
1725 } else {
1726 Err(Status::internal("Integration has no Blynk configuration"))
1727 }
1728 }
1729
1730 async fn update_blynk_integration(
1731 &self,

Callers 1

test_blynk_integrationFunction · 0.80

Calls 6

get_integrationFunction · 0.85
statusMethod · 0.80
to_stringMethod · 0.80
insertMethod · 0.80
unwrapMethod · 0.80
validateMethod · 0.45

Tested by 1

test_blynk_integrationFunction · 0.64