Skip to content

Commit

Permalink
chore: allow passing ids to connections api create methods (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulkr authored Jul 22, 2024
1 parent 9aaafca commit a30d456
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions integrationos-api/src/endpoints/common_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub fn get_router() -> Router<Arc<AppState>> {
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[serde(rename_all = "camelCase")]
pub struct CreateRequest {
pub _id: Option<Id>,
pub name: String,
pub version: Version,
pub fields: Vec<Field>,
Expand Down
1 change: 1 addition & 0 deletions integrationos-api/src/endpoints/connection_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub fn get_router() -> Router<Arc<AppState>> {
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[serde(rename_all = "camelCase")]
pub struct CreateRequest {
pub _id: Option<Id>,
pub platform: String,
pub platform_version: String,
#[serde(default)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ pub async fn test_connection_model_definition(
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[serde(rename_all = "camelCase")]
pub struct CreateRequest {
pub _id: Option<Id>,
pub connection_platform: String,
pub connection_definition_id: Id,
pub platform_version: String,
Expand Down
1 change: 1 addition & 0 deletions integrationos-api/src/endpoints/connection_model_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ pub async fn get_platform_models(
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[serde(rename_all = "camelCase")]
pub struct CreateRequest {
pub _id: Option<Id>,
pub platform_id: Id,
pub platform_page_id: Id,
pub connection_platform: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub fn get_router() -> Router<Arc<AppState>> {
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CreateRequest {
pub _id: Option<Id>,
pub connection_platform: String,
pub platform_redirect_uri: String,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
2 changes: 2 additions & 0 deletions integrationos-api/tests/api_tests/get_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ async fn test_get_expanded_common_model() {
let reference: String = Faker.fake();

let base = common_model::CreateRequest {
_id: None,
name: Faker.fake(),
version: Faker.fake(),
fields: vec![
Expand Down Expand Up @@ -72,6 +73,7 @@ async fn test_get_expanded_common_model() {
};

let expandable = common_model::CreateRequest {
_id: None,
name: reference.clone(),
version: Faker.fake(),
fields: vec![],
Expand Down
1 change: 1 addition & 0 deletions integrationos-api/tests/api_tests/passthrough_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ async fn test_passthrough_api() {
.create();

let create_model_definition_payload = CreateConnectionModelDefinitionRequest {
_id: None,
connection_platform: connection.platform.to_string(),
connection_definition_id: conn_def.id,
platform_version: conn_def.record_metadata.version.to_string(),
Expand Down
1 change: 1 addition & 0 deletions integrationos-api/tests/api_tests/test_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ impl TestServer {
assert!(!connection.secrets_service_id.is_empty());

let model_def = CreateConnectionModelDefinitionRequest {
_id: None,
connection_platform: connection_def.platform,
connection_definition_id: connection_def.id,
platform_version: connection_def.platform_version,
Expand Down
1 change: 1 addition & 0 deletions integrationos-api/tests/api_tests/unified_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ async fn create_connection_model_definition(
.await;

let create_model_definition_payload = CreateConnectionModelDefinitionRequest {
_id: None,
connection_platform: connection.platform.to_string(),
connection_definition_id: connection.connection_definition_id,
platform_version: connection.record_metadata.version.to_string(),
Expand Down

0 comments on commit a30d456

Please sign in to comment.