Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove Connectors enum dependency from ConnectorIntegrationV2 trait #5856

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use router_env::metrics::add_attributes;
use serde_json::json;

use crate::{
api::CaptureSyncMethod, configs::Connectors, errors,
events::connector_api_logs::ConnectorEvent, metrics, types,
api::CaptureSyncMethod, errors, events::connector_api_logs::ConnectorEvent, metrics, types,
};

/// alias for Box of a type that implements trait ConnectorIntegrationV2
Expand Down Expand Up @@ -47,7 +46,6 @@ pub trait ConnectorIntegrationV2<Flow, ResourceCommonData, Req, Resp>:
fn get_headers(
&self,
_req: &RouterDataV2<Flow, ResourceCommonData, Req, Resp>,
_connectors: &Connectors,
) -> CustomResult<Vec<(String, Maskable<String>)>, errors::ConnectorError> {
Ok(vec![])
}
Expand All @@ -66,7 +64,6 @@ pub trait ConnectorIntegrationV2<Flow, ResourceCommonData, Req, Resp>:
fn get_url(
&self,
_req: &RouterDataV2<Flow, ResourceCommonData, Req, Resp>,
_connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(String::new())
}
Expand All @@ -75,7 +72,6 @@ pub trait ConnectorIntegrationV2<Flow, ResourceCommonData, Req, Resp>:
fn get_request_body(
&self,
_req: &RouterDataV2<Flow, ResourceCommonData, Req, Resp>,
_connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
Ok(RequestContent::Json(Box::new(json!(r#"{}"#))))
}
Expand All @@ -92,7 +88,6 @@ pub trait ConnectorIntegrationV2<Flow, ResourceCommonData, Req, Resp>:
fn build_request_v2(
&self,
_req: &RouterDataV2<Flow, ResourceCommonData, Req, Resp>,
_connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
metrics::UNIMPLEMENTED_FLOW.add(
&metrics::CONTEXT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ where
}
ConnectorIntegrationEnum::New(new_integration) => {
let new_router_data = ResourceCommonData::from_old_router_data(req)?;
new_integration.build_request_v2(&new_router_data, connectors)
new_integration.build_request_v2(&new_router_data)
}
}
}
Expand Down
Loading