(name: String, entity: &Entity)
| 182 | } |
| 183 | |
| 184 | fn create_entity_selector(name: String, entity: &Entity) -> Result<Option<EntitySelector>> { |
| 185 | Ok(match entity { |
| 186 | Entity::Monitor(monitor) => monitor |
| 187 | .common() |
| 188 | .id() |
| 189 | .map(|id| EntitySelector::Monitor(name, id)), |
| 190 | Entity::DockerHost(docker_host) => docker_host |
| 191 | .id |
| 192 | .map(|id| EntitySelector::DockerHost(name, id)), |
| 193 | Entity::Notification(notification) => notification |
| 194 | .id |
| 195 | .map(|id| EntitySelector::Notification(name, id)), |
| 196 | Entity::Tag(tag) => tag.tag_id.map(|id| EntitySelector::Tag(name, id)), |
| 197 | Entity::StatusPage(status_page) => status_page |
| 198 | .slug |
| 199 | .as_ref() |
| 200 | .map(|id| EntitySelector::StatusPage(name, id.clone())), |
| 201 | }) |
| 202 | } |
| 203 | |
| 204 | async fn get_connection(&mut self) -> Result<Arc<Client>> { |
| 205 | if self.client.is_none() { |
nothing calls this directly
no test coverage detected