id stringlengths 20 153 | type stringclasses 1
value | granularity stringclasses 14
values | content stringlengths 16 84.3k | metadata dict |
|---|---|---|---|---|
hyperswitch_method_diesel_models_ApiKey_revoke_by_merchant_id_key_id | clm | method | // hyperswitch/crates/diesel_models/src/query/api_keys.rs
// impl for ApiKey
pub async fn revoke_by_merchant_id_key_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
key_id: &common_utils::id_type::ApiKeyId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::key_id.eq(key_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ApiKey",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "revoke_by_merchant_id_key_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_ApiKey_find_optional_by_merchant_id_key_id | clm | method | // hyperswitch/crates/diesel_models/src/query/api_keys.rs
// impl for ApiKey
pub async fn find_optional_by_merchant_id_key_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
key_id: &common_utils::id_type::ApiKeyId,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::key_id.eq(key_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ApiKey",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_optional_by_merchant_id_key_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_ApiKey_find_optional_by_hashed_api_key | clm | method | // hyperswitch/crates/diesel_models/src/query/api_keys.rs
// impl for ApiKey
pub async fn find_optional_by_hashed_api_key(
conn: &PgPooledConn,
hashed_api_key: HashedApiKey,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::hashed_api_key.eq(hashed_api_key),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ApiKey",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_optional_by_hashed_api_key",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_ApiKey_find_by_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/api_keys.rs
// impl for ApiKey
pub async fn find_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
limit: Option<i64>,
offset: Option<i64>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
limit,
offset,
Some(dsl::created_at.asc()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ApiKey",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_DashboardMetadataNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/dashboard_metadata.rs
// impl for DashboardMetadataNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<DashboardMetadata> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "DashboardMetadataNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_DashboardMetadata_update | clm | method | // hyperswitch/crates/diesel_models/src/query/dashboard_metadata.rs
// impl for DashboardMetadata
pub async fn update(
conn: &PgPooledConn,
user_id: Option<String>,
merchant_id: id_type::MerchantId,
org_id: id_type::OrganizationId,
data_key: enums::DashboardMetadata,
dashboard_metadata_update: DashboardMetadataUpdate,
) -> StorageResult<Self> {
let predicate = dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::org_id.eq(org_id.to_owned()))
.and(dsl::data_key.eq(data_key.to_owned()));
if let Some(uid) = user_id {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
predicate.and(dsl::user_id.eq(uid)),
DashboardMetadataUpdateInternal::from(dashboard_metadata_update),
)
.await
} else {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
predicate.and(dsl::user_id.is_null()),
DashboardMetadataUpdateInternal::from(dashboard_metadata_update),
)
.await
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "DashboardMetadata",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_DashboardMetadata_find_user_scoped_dashboard_metadata | clm | method | // hyperswitch/crates/diesel_models/src/query/dashboard_metadata.rs
// impl for DashboardMetadata
pub async fn find_user_scoped_dashboard_metadata(
conn: &PgPooledConn,
user_id: String,
merchant_id: id_type::MerchantId,
org_id: id_type::OrganizationId,
data_types: Vec<enums::DashboardMetadata>,
) -> StorageResult<Vec<Self>> {
let predicate = dsl::user_id
.eq(user_id)
.and(dsl::merchant_id.eq(merchant_id))
.and(dsl::org_id.eq(org_id))
.and(dsl::data_key.eq_any(data_types));
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
predicate,
None,
None,
Some(dsl::last_modified_at.asc()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "DashboardMetadata",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_user_scoped_dashboard_metadata",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_DashboardMetadata_find_merchant_scoped_dashboard_metadata | clm | method | // hyperswitch/crates/diesel_models/src/query/dashboard_metadata.rs
// impl for DashboardMetadata
pub async fn find_merchant_scoped_dashboard_metadata(
conn: &PgPooledConn,
merchant_id: id_type::MerchantId,
org_id: id_type::OrganizationId,
data_types: Vec<enums::DashboardMetadata>,
) -> StorageResult<Vec<Self>> {
let predicate = dsl::merchant_id
.eq(merchant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::data_key.eq_any(data_types));
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
predicate,
None,
None,
Some(dsl::last_modified_at.asc()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "DashboardMetadata",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_merchant_scoped_dashboard_metadata",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_DashboardMetadata_delete_all_user_scoped_dashboard_metadata_by_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/dashboard_metadata.rs
// impl for DashboardMetadata
pub async fn delete_all_user_scoped_dashboard_metadata_by_merchant_id(
conn: &PgPooledConn,
user_id: String,
merchant_id: id_type::MerchantId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::user_id
.eq(user_id)
.and(dsl::merchant_id.eq(merchant_id)),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "DashboardMetadata",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "delete_all_user_scoped_dashboard_metadata_by_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_DashboardMetadata_delete_user_scoped_dashboard_metadata_by_merchant_id_data_key | clm | method | // hyperswitch/crates/diesel_models/src/query/dashboard_metadata.rs
// impl for DashboardMetadata
pub async fn delete_user_scoped_dashboard_metadata_by_merchant_id_data_key(
conn: &PgPooledConn,
user_id: String,
merchant_id: id_type::MerchantId,
data_key: enums::DashboardMetadata,
) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, _>(
conn,
dsl::user_id
.eq(user_id)
.and(dsl::merchant_id.eq(merchant_id))
.and(dsl::data_key.eq(data_key)),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "DashboardMetadata",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "delete_user_scoped_dashboard_metadata_by_merchant_id_data_key",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_CustomerNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/customers.rs
// impl for CustomerNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Customer> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "CustomerNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Customer_update_by_id | clm | method | // hyperswitch/crates/diesel_models/src/query/customers.rs
// impl for Customer
pub async fn update_by_id(
conn: &PgPooledConn,
id: id_type::GlobalCustomerId,
customer: CustomerUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
id.clone(),
customer,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, id).await
}
_ => Err(error),
},
result => result,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Customer",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_by_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Customer_find_by_global_id | clm | method | // hyperswitch/crates/diesel_models/src/query/customers.rs
// impl for Customer
pub async fn find_by_global_id(
conn: &PgPooledConn,
id: &id_type::GlobalCustomerId,
) -> StorageResult<Self> {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, id.to_owned()).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Customer",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_global_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Customer_get_customer_count_by_merchant_id_and_constraints | clm | method | // hyperswitch/crates/diesel_models/src/query/customers.rs
// impl for Customer
pub async fn get_customer_count_by_merchant_id_and_constraints(
conn: &PgPooledConn,
merchant_id: &id_type::MerchantId,
customer_list_constraints: CustomerListConstraints,
) -> StorageResult<usize> {
if let Some(customer_id) = customer_list_constraints.customer_id {
let predicate = dsl::merchant_id
.eq(merchant_id.clone())
.and(dsl::merchant_reference_id.eq(customer_id));
generics::generic_count::<<Self as HasTable>::Table, _>(conn, predicate).await
} else if let Some(time_range) = customer_list_constraints.time_range {
let start_time = time_range.start_time;
let end_time = time_range
.end_time
.unwrap_or_else(common_utils::date_time::now);
let predicate = dsl::merchant_id
.eq(merchant_id.clone())
.and(dsl::created_at.between(start_time, end_time));
generics::generic_count::<<Self as HasTable>::Table, _>(conn, predicate).await
} else {
generics::generic_count::<<Self as HasTable>::Table, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
)
.await
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Customer",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_customer_count_by_merchant_id_and_constraints",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Customer_list_customers_by_merchant_id_and_constraints | clm | method | // hyperswitch/crates/diesel_models/src/query/customers.rs
// impl for Customer
pub async fn list_customers_by_merchant_id_and_constraints(
conn: &PgPooledConn,
merchant_id: &id_type::MerchantId,
constraints: CustomerListConstraints,
) -> StorageResult<Vec<Self>> {
if let Some(customer_id) = constraints.customer_id {
let predicate = dsl::merchant_id
.eq(merchant_id.clone())
.and(dsl::merchant_reference_id.eq(customer_id));
generics::generic_filter::<<Self as HasTable>::Table, _, _, Self>(
conn,
predicate,
Some(constraints.limit),
constraints.offset,
Some(dsl::created_at),
)
.await
} else if let Some(time_range) = constraints.time_range {
let start_time = time_range.start_time;
let end_time = time_range
.end_time
.unwrap_or_else(common_utils::date_time::now);
let predicate = dsl::merchant_id
.eq(merchant_id.clone())
.and(dsl::created_at.between(start_time, end_time));
generics::generic_filter::<<Self as HasTable>::Table, _, _, Self>(
conn,
predicate,
Some(constraints.limit),
constraints.offset,
Some(dsl::created_at),
)
.await
} else {
let predicate = dsl::merchant_id.eq(merchant_id.clone());
generics::generic_filter::<<Self as HasTable>::Table, _, _, Self>(
conn,
predicate,
Some(constraints.limit),
constraints.offset,
Some(dsl::created_at),
)
.await
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Customer",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "list_customers_by_merchant_id_and_constraints",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Customer_find_optional_by_merchant_id_merchant_reference_id | clm | method | // hyperswitch/crates/diesel_models/src/query/customers.rs
// impl for Customer
pub async fn find_optional_by_merchant_id_merchant_reference_id(
conn: &PgPooledConn,
customer_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::merchant_reference_id.eq(customer_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Customer",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_optional_by_merchant_id_merchant_reference_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Customer_find_optional_by_customer_id_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/customers.rs
// impl for Customer
pub async fn find_optional_by_customer_id_merchant_id(
conn: &PgPooledConn,
customer_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
) -> StorageResult<Option<Self>> {
generics::generic_find_by_id_optional::<<Self as HasTable>::Table, _, _>(
conn,
(customer_id.to_owned(), merchant_id.to_owned()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Customer",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_optional_by_customer_id_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Customer_update_by_customer_id_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/customers.rs
// impl for Customer
pub async fn update_by_customer_id_merchant_id(
conn: &PgPooledConn,
customer_id: id_type::CustomerId,
merchant_id: id_type::MerchantId,
customer: CustomerUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
(customer_id.clone(), merchant_id.clone()),
customer,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(
conn,
(customer_id, merchant_id),
)
.await
}
_ => Err(error),
},
result => result,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Customer",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_by_customer_id_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Customer_delete_by_customer_id_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/customers.rs
// impl for Customer
pub async fn delete_by_customer_id_merchant_id(
conn: &PgPooledConn,
customer_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::customer_id
.eq(customer_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Customer",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "delete_by_customer_id_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Customer_find_by_merchant_reference_id_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/customers.rs
// impl for Customer
pub async fn find_by_merchant_reference_id_merchant_id(
conn: &PgPooledConn,
merchant_reference_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::merchant_reference_id.eq(merchant_reference_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Customer",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_reference_id_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Customer_find_by_customer_id_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/customers.rs
// impl for Customer
pub async fn find_by_customer_id_merchant_id(
conn: &PgPooledConn,
customer_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(
conn,
(customer_id.to_owned(), merchant_id.to_owned()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Customer",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_customer_id_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_GatewayStatusMappingNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/gsm.rs
// impl for GatewayStatusMappingNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<GatewayStatusMap> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "GatewayStatusMappingNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_GatewayStatusMap_find | clm | method | // hyperswitch/crates/diesel_models/src/query/gsm.rs
// impl for GatewayStatusMap
pub async fn find(
conn: &PgPooledConn,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::connector
.eq(connector)
.and(dsl::flow.eq(flow))
.and(dsl::sub_flow.eq(sub_flow))
.and(dsl::code.eq(code))
.and(dsl::message.eq(message)),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "GatewayStatusMap",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_GatewayStatusMap_retrieve_decision | clm | method | // hyperswitch/crates/diesel_models/src/query/gsm.rs
// impl for GatewayStatusMap
pub async fn retrieve_decision(
conn: &PgPooledConn,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
) -> StorageResult<String> {
Self::find(conn, connector, flow, sub_flow, code, message)
.await
.map(|item| item.decision)
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "GatewayStatusMap",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "retrieve_decision",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_GatewayStatusMap_update | clm | method | // hyperswitch/crates/diesel_models/src/query/gsm.rs
// impl for GatewayStatusMap
pub async fn update(
conn: &PgPooledConn,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
gsm: GatewayStatusMappingUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_results::<
<Self as HasTable>::Table,
GatewayStatusMapperUpdateInternal,
_,
_,
>(
conn,
dsl::connector
.eq(connector)
.and(dsl::flow.eq(flow))
.and(dsl::sub_flow.eq(sub_flow))
.and(dsl::code.eq(code))
.and(dsl::message.eq(message)),
gsm.into(),
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(errors::DatabaseError::NotFound)
.attach_printable("Error while updating gsm entry")
})
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "GatewayStatusMap",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_GatewayStatusMap_delete | clm | method | // hyperswitch/crates/diesel_models/src/query/gsm.rs
// impl for GatewayStatusMap
pub async fn delete(
conn: &PgPooledConn,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::connector
.eq(connector)
.and(dsl::flow.eq(flow))
.and(dsl::sub_flow.eq(sub_flow))
.and(dsl::code.eq(code))
.and(dsl::message.eq(message)),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "GatewayStatusMap",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "delete",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_ConnectorResponseNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/connector_response.rs
// impl for ConnectorResponseNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<ConnectorResponse> {
let payment_attempt_update = PaymentAttemptUpdate::ConnectorResponse {
authentication_data: self.authentication_data.clone(),
encoded_data: self.encoded_data.clone(),
connector_transaction_id: self.connector_transaction_id.clone(),
connector: self.connector_name.clone(),
updated_by: self.updated_by.clone(),
charge_id: self.charge_id.clone(),
};
let _payment_attempt: Result<PaymentAttempt, _> =
generics::generic_update_with_unique_predicate_get_result::<
<PaymentAttempt as HasTable>::Table,
_,
_,
_,
>(
conn,
pa_dsl::attempt_id
.eq(self.attempt_id.to_owned())
.and(pa_dsl::merchant_id.eq(self.merchant_id.to_owned())),
PaymentAttemptUpdateInternal::from(payment_attempt_update),
)
.await
.inspect_err(|err| {
logger::error!(
"Error while updating payment attempt in connector_response flow {:?}",
err
);
});
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorResponseNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_ConnectorResponse_update | clm | method | // hyperswitch/crates/diesel_models/src/query/connector_response.rs
// impl for ConnectorResponse
pub async fn update(
self,
conn: &PgPooledConn,
connector_response: ConnectorResponseUpdate,
) -> StorageResult<Self> {
let payment_attempt_update = match connector_response.clone() {
ConnectorResponseUpdate::ResponseUpdate {
connector_transaction_id,
authentication_data,
encoded_data,
connector_name,
charge_id,
updated_by,
} => PaymentAttemptUpdate::ConnectorResponse {
authentication_data,
encoded_data,
connector_transaction_id,
connector: connector_name,
charge_id,
updated_by,
},
ConnectorResponseUpdate::ErrorUpdate {
connector_name,
updated_by,
} => PaymentAttemptUpdate::ConnectorResponse {
authentication_data: None,
encoded_data: None,
connector_transaction_id: None,
connector: connector_name,
charge_id: None,
updated_by,
},
};
let _payment_attempt: Result<PaymentAttempt, _> =
generics::generic_update_with_unique_predicate_get_result::<
<PaymentAttempt as HasTable>::Table,
_,
_,
_,
>(
conn,
pa_dsl::attempt_id
.eq(self.attempt_id.to_owned())
.and(pa_dsl::merchant_id.eq(self.merchant_id.to_owned())),
PaymentAttemptUpdateInternal::from(payment_attempt_update),
)
.await
.inspect_err(|err| {
logger::error!(
"Error while updating payment attempt in connector_response flow {:?}",
err
);
});
let connector_response_result =
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::merchant_id
.eq(self.merchant_id.clone())
.and(dsl::payment_id.eq(self.payment_id.clone()))
.and(dsl::attempt_id.eq(self.attempt_id.clone())),
ConnectorResponseUpdateInternal::from(connector_response),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
};
connector_response_result
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_ConnectorResponse_find_by_payment_id_merchant_id_attempt_id | clm | method | // hyperswitch/crates/diesel_models/src/query/connector_response.rs
// impl for ConnectorResponse
pub async fn find_by_payment_id_merchant_id_attempt_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
attempt_id: &str,
) -> StorageResult<Self> {
let connector_response: Self =
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()).and(
dsl::payment_id
.eq(payment_id.to_owned())
.and(dsl::attempt_id.eq(attempt_id.to_owned())),
),
)
.await?;
match generics::generic_find_one::<<PaymentAttempt as HasTable>::Table, _, _>(
conn,
pa_dsl::payment_id.eq(payment_id.to_owned()).and(
pa_dsl::merchant_id
.eq(merchant_id.to_owned())
.and(pa_dsl::attempt_id.eq(attempt_id.to_owned())),
),
)
.await
{
Ok::<PaymentAttempt, _>(payment_attempt) => {
if payment_attempt.authentication_data != connector_response.authentication_data {
logger::error!(
"Not Equal pa_authentication_data : {:?}, cr_authentication_data: {:?} ",
payment_attempt.authentication_data,
connector_response.authentication_data
);
}
if payment_attempt.encoded_data != connector_response.encoded_data {
logger::error!(
"Not Equal pa_encoded_data : {:?}, cr_encoded_data: {:?} ",
payment_attempt.encoded_data,
connector_response.encoded_data
);
}
if payment_attempt.connector_transaction_id
!= connector_response.connector_transaction_id
{
logger::error!(
"Not Equal pa_connector_transaction_id : {:?}, cr_connector_transaction_id: {:?} ",
payment_attempt.connector_transaction_id,
connector_response.connector_transaction_id
);
}
if payment_attempt.connector != connector_response.connector_name {
logger::error!(
"Not Equal pa_connector : {:?}, cr_connector_name: {:?} ",
payment_attempt.connector,
connector_response.connector_name
);
}
}
Err(err) => {
logger::error!(
"Error while finding payment attempt in connector_response flow {:?}",
err
);
}
}
Ok(connector_response)
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_payment_id_merchant_id_attempt_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_HyperswitchAiInteractionNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/hyperswitch_ai_interaction.rs
// impl for HyperswitchAiInteractionNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<HyperswitchAiInteraction> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "HyperswitchAiInteractionNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_HyperswitchAiInteraction_filter_by_optional_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/hyperswitch_ai_interaction.rs
// impl for HyperswitchAiInteraction
pub async fn filter_by_optional_merchant_id(
conn: &PgPooledConn,
merchant_id: Option<&common_utils::id_type::MerchantId>,
limit: i64,
offset: i64,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id.eq(merchant_id.cloned()),
Some(limit),
Some(offset),
Some(dsl::created_at.desc()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "HyperswitchAiInteraction",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "filter_by_optional_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PayoutAttemptNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/payout_attempt.rs
// impl for PayoutAttemptNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<PayoutAttempt> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PayoutAttemptNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PayoutAttempt_update_with_attempt_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payout_attempt.rs
// impl for PayoutAttempt
pub async fn update_with_attempt_id(
self,
conn: &PgPooledConn,
payout_attempt_update: PayoutAttemptUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::payout_attempt_id
.eq(self.payout_attempt_id.to_owned())
.and(dsl::merchant_id.eq(self.merchant_id.to_owned())),
PayoutAttemptUpdateInternal::from(payout_attempt_update),
)
.await
{
Err(error) => match error.current_context() {
DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PayoutAttempt",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_with_attempt_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PayoutAttempt_find_by_merchant_id_payout_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payout_attempt.rs
// impl for PayoutAttempt
pub async fn find_by_merchant_id_payout_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payout_id: &common_utils::id_type::PayoutId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payout_id.eq(payout_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PayoutAttempt",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id_payout_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PayoutAttempt_find_by_merchant_id_payout_attempt_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payout_attempt.rs
// impl for PayoutAttempt
pub async fn find_by_merchant_id_payout_attempt_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payout_attempt_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payout_attempt_id.eq(payout_attempt_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PayoutAttempt",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id_payout_attempt_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PayoutAttempt_find_by_merchant_id_connector_payout_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payout_attempt.rs
// impl for PayoutAttempt
pub async fn find_by_merchant_id_connector_payout_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
connector_payout_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::connector_payout_id.eq(connector_payout_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PayoutAttempt",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id_connector_payout_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PayoutAttempt_find_by_merchant_id_merchant_order_reference_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payout_attempt.rs
// impl for PayoutAttempt
pub async fn find_by_merchant_id_merchant_order_reference_id(
conn: &PgPooledConn,
merchant_id_input: &common_utils::id_type::MerchantId,
merchant_order_reference_id_input: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id.eq(merchant_id_input.to_owned()).and(
dsl::merchant_order_reference_id.eq(merchant_order_reference_id_input.to_owned()),
),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PayoutAttempt",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id_merchant_order_reference_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PayoutAttempt_update_by_merchant_id_payout_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payout_attempt.rs
// impl for PayoutAttempt
pub async fn update_by_merchant_id_payout_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payout_id: &common_utils::id_type::PayoutId,
payout: PayoutAttemptUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payout_id.eq(payout_id.to_owned())),
PayoutAttemptUpdateInternal::from(payout),
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(DatabaseError::NotFound).attach_printable("Error while updating payout")
})
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PayoutAttempt",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_by_merchant_id_payout_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PayoutAttempt_update_by_merchant_id_payout_attempt_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payout_attempt.rs
// impl for PayoutAttempt
pub async fn update_by_merchant_id_payout_attempt_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payout_attempt_id: &str,
payout: PayoutAttemptUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payout_attempt_id.eq(payout_attempt_id.to_owned())),
PayoutAttemptUpdateInternal::from(payout),
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(DatabaseError::NotFound).attach_printable("Error while updating payout")
})
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PayoutAttempt",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_by_merchant_id_payout_attempt_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PayoutAttempt_get_filters_for_payouts | clm | method | // hyperswitch/crates/diesel_models/src/query/payout_attempt.rs
// impl for PayoutAttempt
pub async fn get_filters_for_payouts(
conn: &PgPooledConn,
payouts: &[Payouts],
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<(
Vec<String>,
Vec<enums::Currency>,
Vec<enums::PayoutStatus>,
Vec<enums::PayoutType>,
)> {
let active_attempt_ids = payouts
.iter()
.map(|payout| {
format!(
"{}_{}",
payout.payout_id.get_string_repr(),
payout.attempt_count.clone()
)
})
.collect::<Vec<String>>();
let active_payout_ids = payouts
.iter()
.map(|payout| payout.payout_id.to_owned())
.collect::<Vec<common_utils::id_type::PayoutId>>();
let filter = <Self as HasTable>::table()
.filter(dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(dsl::payout_attempt_id.eq_any(active_attempt_ids));
let payouts_filter = <Payouts as HasTable>::table()
.filter(payout_dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(payout_dsl::payout_id.eq_any(active_payout_ids));
let payout_status: Vec<enums::PayoutStatus> = payouts
.iter()
.map(|payout| payout.status)
.collect::<HashSet<enums::PayoutStatus>>()
.into_iter()
.collect();
let filter_connector = filter
.clone()
.select(dsl::connector)
.distinct()
.get_results_async::<Option<String>>(conn)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering records by connector")?
.into_iter()
.flatten()
.collect::<Vec<String>>();
let filter_currency = payouts_filter
.clone()
.select(payout_dsl::destination_currency)
.distinct()
.get_results_async::<enums::Currency>(conn)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering records by currency")?
.into_iter()
.collect::<Vec<enums::Currency>>();
let filter_payout_method = payouts_filter
.clone()
.select(payout_dsl::payout_type)
.distinct()
.get_results_async::<Option<enums::PayoutType>>(conn)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering records by payout type")?
.into_iter()
.flatten()
.collect::<Vec<enums::PayoutType>>();
Ok((
filter_connector,
filter_currency,
payout_status,
filter_payout_method,
))
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PayoutAttempt",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_filters_for_payouts",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_AuthenticationNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/authentication.rs
// impl for AuthenticationNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Authentication> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "AuthenticationNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Authentication_update_by_merchant_id_authentication_id | clm | method | // hyperswitch/crates/diesel_models/src/query/authentication.rs
// impl for Authentication
pub async fn update_by_merchant_id_authentication_id(
conn: &PgPooledConn,
merchant_id: common_utils::id_type::MerchantId,
authentication_id: common_utils::id_type::AuthenticationId,
authorization_update: AuthenticationUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::authentication_id.eq(authentication_id.to_owned())),
AuthenticationUpdateInternal::from(authorization_update),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NotFound => Err(error.attach_printable(
"Authentication with the given Authentication ID does not exist",
)),
errors::DatabaseError::NoFieldsToUpdate => {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::authentication_id.eq(authentication_id.to_owned())),
)
.await
}
_ => Err(error),
},
result => result,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Authentication",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_by_merchant_id_authentication_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Authentication_find_by_merchant_id_authentication_id | clm | method | // hyperswitch/crates/diesel_models/src/query/authentication.rs
// impl for Authentication
pub async fn find_by_merchant_id_authentication_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
authentication_id: &common_utils::id_type::AuthenticationId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::authentication_id.eq(authentication_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Authentication",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id_authentication_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Authentication_find_authentication_by_merchant_id_connector_authentication_id | clm | method | // hyperswitch/crates/diesel_models/src/query/authentication.rs
// impl for Authentication
pub async fn find_authentication_by_merchant_id_connector_authentication_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
connector_authentication_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::connector_authentication_id.eq(connector_authentication_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Authentication",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_authentication_by_merchant_id_connector_authentication_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_MerchantKeyStoreNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/merchant_key_store.rs
// impl for MerchantKeyStoreNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<MerchantKeyStore> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantKeyStoreNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_MerchantKeyStore_find_by_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/merchant_key_store.rs
// impl for MerchantKeyStore
pub async fn find_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantKeyStore",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_MerchantKeyStore_delete_by_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/merchant_key_store.rs
// impl for MerchantKeyStore
pub async fn delete_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantKeyStore",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "delete_by_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_MerchantKeyStore_list_multiple_key_stores | clm | method | // hyperswitch/crates/diesel_models/src/query/merchant_key_store.rs
// impl for MerchantKeyStore
pub async fn list_multiple_key_stores(
conn: &PgPooledConn,
merchant_ids: Vec<common_utils::id_type::MerchantId>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as diesel::Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id.eq_any(merchant_ids),
None,
None,
None,
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantKeyStore",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "list_multiple_key_stores",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_MerchantKeyStore_list_all_key_stores | clm | method | // hyperswitch/crates/diesel_models/src/query/merchant_key_store.rs
// impl for MerchantKeyStore
pub async fn list_all_key_stores(
conn: &PgPooledConn,
from: u32,
limit: u32,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as diesel::Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id.ne_all(vec!["".to_string()]),
Some(limit.into()),
Some(from.into()),
None,
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantKeyStore",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "list_all_key_stores",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_UserKeyStoreNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/user_key_store.rs
// impl for UserKeyStoreNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<UserKeyStore> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "UserKeyStoreNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_UserKeyStore_get_all_user_key_stores | clm | method | // hyperswitch/crates/diesel_models/src/query/user_key_store.rs
// impl for UserKeyStore
pub async fn get_all_user_key_stores(
conn: &PgPooledConn,
from: u32,
limit: u32,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as diesel::Table>::PrimaryKey,
_,
>(
conn,
dsl::user_id.ne_all(vec!["".to_string()]),
Some(limit.into()),
Some(from.into()),
None,
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "UserKeyStore",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_all_user_key_stores",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_UserKeyStore_find_by_user_id | clm | method | // hyperswitch/crates/diesel_models/src/query/user_key_store.rs
// impl for UserKeyStore
pub async fn find_by_user_id(conn: &PgPooledConn, user_id: &str) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::user_id.eq(user_id.to_owned()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "UserKeyStore",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_user_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_ReverseLookupNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/reverse_lookup.rs
// impl for ReverseLookupNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<ReverseLookup> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ReverseLookupNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_ReverseLookupNew_batch_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/reverse_lookup.rs
// impl for ReverseLookupNew
pub async fn batch_insert(
reverse_lookups: Vec<Self>,
conn: &PgPooledConn,
) -> StorageResult<()> {
generics::generic_insert::<_, _, ReverseLookup>(conn, reverse_lookups).await?;
Ok(())
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ReverseLookupNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "batch_insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_ReverseLookup_find_by_lookup_id | clm | method | // hyperswitch/crates/diesel_models/src/query/reverse_lookup.rs
// impl for ReverseLookup
pub async fn find_by_lookup_id(lookup_id: &str, conn: &PgPooledConn) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::lookup_id.eq(lookup_id.to_owned()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ReverseLookup",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_lookup_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_RelayNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/relay.rs
// impl for RelayNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Relay> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "RelayNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Relay_update | clm | method | // hyperswitch/crates/diesel_models/src/query/relay.rs
// impl for Relay
pub async fn update(
self,
conn: &PgPooledConn,
relay: RelayUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(conn, dsl::id.eq(self.id.to_owned()), relay)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Relay",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Relay_find_by_id | clm | method | // hyperswitch/crates/diesel_models/src/query/relay.rs
// impl for Relay
pub async fn find_by_id(
conn: &PgPooledConn,
id: &common_utils::id_type::RelayId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::id.eq(id.to_owned()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Relay",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Relay_find_by_profile_id_connector_reference_id | clm | method | // hyperswitch/crates/diesel_models/src/query/relay.rs
// impl for Relay
pub async fn find_by_profile_id_connector_reference_id(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
connector_reference_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::profile_id
.eq(profile_id.to_owned())
.and(dsl::connector_reference_id.eq(connector_reference_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Relay",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_profile_id_connector_reference_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_MandateNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/mandate.rs
// impl for MandateNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Mandate> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MandateNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Mandate_find_by_merchant_id_mandate_id | clm | method | // hyperswitch/crates/diesel_models/src/query/mandate.rs
// impl for Mandate
pub async fn find_by_merchant_id_mandate_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
mandate_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::mandate_id.eq(mandate_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Mandate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id_mandate_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Mandate_find_by_merchant_id_connector_mandate_id | clm | method | // hyperswitch/crates/diesel_models/src/query/mandate.rs
// impl for Mandate
pub async fn find_by_merchant_id_connector_mandate_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
connector_mandate_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::connector_mandate_id.eq(connector_mandate_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Mandate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id_connector_mandate_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Mandate_find_by_merchant_id_customer_id | clm | method | // hyperswitch/crates/diesel_models/src/query/mandate.rs
// impl for Mandate
pub async fn find_by_merchant_id_customer_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
customer_id: &common_utils::id_type::CustomerId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::customer_id.eq(customer_id.to_owned())),
None,
None,
None,
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Mandate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id_customer_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Mandate_find_by_global_customer_id | clm | method | // hyperswitch/crates/diesel_models/src/query/mandate.rs
// impl for Mandate
pub async fn find_by_global_customer_id(
conn: &PgPooledConn,
customer_id: &common_utils::id_type::GlobalCustomerId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::customer_id.eq(customer_id.to_owned()),
None,
None,
None,
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Mandate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_global_customer_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Mandate_update_by_merchant_id_mandate_id | clm | method | // hyperswitch/crates/diesel_models/src/query/mandate.rs
// impl for Mandate
pub async fn update_by_merchant_id_mandate_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
mandate_id: &str,
mandate: MandateUpdateInternal,
) -> StorageResult<Self> {
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::mandate_id.eq(mandate_id.to_owned())),
mandate,
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(errors::DatabaseError::NotFound)
.attach_printable("Error while updating mandate")
})
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Mandate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_by_merchant_id_mandate_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PaymentIntentNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/payment_intent.rs
// impl for PaymentIntentNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<PaymentIntent> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntentNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PaymentIntent_update | clm | method | // hyperswitch/crates/diesel_models/src/query/payment_intent.rs
// impl for PaymentIntent
pub async fn update(
self,
conn: &PgPooledConn,
payment_intent: payment_intent::PaymentIntentUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::payment_id
.eq(self.payment_id.to_owned())
.and(dsl::merchant_id.eq(self.merchant_id.to_owned())),
payment_intent::PaymentIntentUpdateInternal::from(payment_intent),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
Ok(mut payment_intents) => payment_intents
.pop()
.ok_or(error_stack::report!(errors::DatabaseError::NotFound)),
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PaymentIntent_find_by_global_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payment_intent.rs
// impl for PaymentIntent
pub async fn find_by_global_id(
conn: &PgPooledConn,
id: &common_utils::id_type::GlobalPaymentId,
) -> StorageResult<Self> {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, id.to_owned()).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_global_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PaymentIntent_find_by_merchant_reference_id_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payment_intent.rs
// impl for PaymentIntent
pub async fn find_by_merchant_reference_id_merchant_id(
conn: &PgPooledConn,
merchant_reference_id: &str,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::merchant_reference_id.eq(merchant_reference_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_reference_id_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PaymentIntent_find_by_merchant_reference_id_profile_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payment_intent.rs
// impl for PaymentIntent
pub async fn find_by_merchant_reference_id_profile_id(
conn: &PgPooledConn,
merchant_reference_id: &common_utils::id_type::PaymentReferenceId,
profile_id: &common_utils::id_type::ProfileId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::profile_id
.eq(profile_id.to_owned())
.and(dsl::merchant_reference_id.eq(merchant_reference_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_reference_id_profile_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PaymentIntent_find_by_payment_id_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payment_intent.rs
// impl for PaymentIntent
pub async fn find_by_payment_id_merchant_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_payment_id_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PaymentIntent_find_optional_by_merchant_reference_id_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payment_intent.rs
// impl for PaymentIntent
pub async fn find_optional_by_merchant_reference_id_merchant_id(
conn: &PgPooledConn,
merchant_reference_id: &str,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::merchant_reference_id.eq(merchant_reference_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_optional_by_merchant_reference_id_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_PaymentIntent_find_optional_by_payment_id_merchant_id | clm | method | // hyperswitch/crates/diesel_models/src/query/payment_intent.rs
// impl for PaymentIntent
pub async fn find_optional_by_payment_id_merchant_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_optional_by_payment_id_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_CaptureNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/capture.rs
// impl for CaptureNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Capture> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "CaptureNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Capture_find_by_capture_id | clm | method | // hyperswitch/crates/diesel_models/src/query/capture.rs
// impl for Capture
pub async fn find_by_capture_id(conn: &PgPooledConn, capture_id: &str) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::capture_id.eq(capture_id.to_owned()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Capture",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_capture_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Capture_update_with_capture_id | clm | method | // hyperswitch/crates/diesel_models/src/query/capture.rs
// impl for Capture
pub async fn update_with_capture_id(
self,
conn: &PgPooledConn,
capture: CaptureUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::capture_id.eq(self.capture_id.to_owned()),
CaptureUpdateInternal::from(capture),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Capture",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_with_capture_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Capture_find_all_by_merchant_id_payment_id_authorized_attempt_id | clm | method | // hyperswitch/crates/diesel_models/src/query/capture.rs
// impl for Capture
pub async fn find_all_by_merchant_id_payment_id_authorized_attempt_id(
merchant_id: &common_utils::id_type::MerchantId,
payment_id: &common_utils::id_type::PaymentId,
authorized_attempt_id: &str,
conn: &PgPooledConn,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::authorized_attempt_id
.eq(authorized_attempt_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned()))
.and(dsl::payment_id.eq(payment_id.to_owned())),
None,
None,
Some(dsl::created_at.asc()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Capture",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_all_by_merchant_id_payment_id_authorized_attempt_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_AuthorizationNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/authorization.rs
// impl for AuthorizationNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Authorization> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "AuthorizationNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Authorization_update_by_merchant_id_authorization_id | clm | method | // hyperswitch/crates/diesel_models/src/query/authorization.rs
// impl for Authorization
pub async fn update_by_merchant_id_authorization_id(
conn: &PgPooledConn,
merchant_id: common_utils::id_type::MerchantId,
authorization_id: String,
authorization_update: AuthorizationUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::authorization_id.eq(authorization_id.to_owned())),
AuthorizationUpdateInternal::from(authorization_update),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NotFound => Err(error.attach_printable(
"Authorization with the given Authorization ID does not exist",
)),
errors::DatabaseError::NoFieldsToUpdate => {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::authorization_id.eq(authorization_id.to_owned())),
)
.await
}
_ => Err(error),
},
result => result,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Authorization",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_by_merchant_id_authorization_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Authorization_find_by_merchant_id_payment_id | clm | method | // hyperswitch/crates/diesel_models/src/query/authorization.rs
// impl for Authorization
pub async fn find_by_merchant_id_payment_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payment_id: &common_utils::id_type::PaymentId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned())),
None,
None,
Some(dsl::created_at.asc()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Authorization",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id_payment_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_UserAuthenticationMethodNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/user_authentication_method.rs
// impl for UserAuthenticationMethodNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<UserAuthenticationMethod> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "UserAuthenticationMethodNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_UserAuthenticationMethod_get_user_authentication_method_by_id | clm | method | // hyperswitch/crates/diesel_models/src/query/user_authentication_method.rs
// impl for UserAuthenticationMethod
pub async fn get_user_authentication_method_by_id(
conn: &PgPooledConn,
id: &str,
) -> StorageResult<Self> {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, id.to_owned()).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "UserAuthenticationMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_user_authentication_method_by_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_UserAuthenticationMethod_list_user_authentication_methods_for_auth_id | clm | method | // hyperswitch/crates/diesel_models/src/query/user_authentication_method.rs
// impl for UserAuthenticationMethod
pub async fn list_user_authentication_methods_for_auth_id(
conn: &PgPooledConn,
auth_id: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::auth_id.eq(auth_id.to_owned()),
None,
None,
Some(dsl::last_modified_at.asc()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "UserAuthenticationMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "list_user_authentication_methods_for_auth_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_UserAuthenticationMethod_list_user_authentication_methods_for_owner_id | clm | method | // hyperswitch/crates/diesel_models/src/query/user_authentication_method.rs
// impl for UserAuthenticationMethod
pub async fn list_user_authentication_methods_for_owner_id(
conn: &PgPooledConn,
owner_id: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::owner_id.eq(owner_id.to_owned()),
None,
None,
Some(dsl::last_modified_at.asc()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "UserAuthenticationMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "list_user_authentication_methods_for_owner_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_UserAuthenticationMethod_update_user_authentication_method | clm | method | // hyperswitch/crates/diesel_models/src/query/user_authentication_method.rs
// impl for UserAuthenticationMethod
pub async fn update_user_authentication_method(
conn: &PgPooledConn,
id: &str,
user_authentication_method_update: UserAuthenticationMethodUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::id.eq(id.to_owned()),
OrgAuthenticationMethodUpdateInternal::from(user_authentication_method_update),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "UserAuthenticationMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_user_authentication_method",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_UserAuthenticationMethod_list_user_authentication_methods_for_email_domain | clm | method | // hyperswitch/crates/diesel_models/src/query/user_authentication_method.rs
// impl for UserAuthenticationMethod
pub async fn list_user_authentication_methods_for_email_domain(
conn: &PgPooledConn,
email_domain: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::email_domain.eq(email_domain.to_owned()),
None,
None,
Some(dsl::last_modified_at.asc()),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "UserAuthenticationMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "list_user_authentication_methods_for_email_domain",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_FileMetadataNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/file.rs
// impl for FileMetadataNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<FileMetadata> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "FileMetadataNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_FileMetadata_find_by_merchant_id_file_id | clm | method | // hyperswitch/crates/diesel_models/src/query/file.rs
// impl for FileMetadata
pub async fn find_by_merchant_id_file_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
file_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::file_id.eq(file_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "FileMetadata",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_merchant_id_file_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_FileMetadata_delete_by_merchant_id_file_id | clm | method | // hyperswitch/crates/diesel_models/src/query/file.rs
// impl for FileMetadata
pub async fn delete_by_merchant_id_file_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
file_id: &str,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::file_id.eq(file_id.to_owned())),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "FileMetadata",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "delete_by_merchant_id_file_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_FileMetadata_update | clm | method | // hyperswitch/crates/diesel_models/src/query/file.rs
// impl for FileMetadata
pub async fn update(
self,
conn: &PgPooledConn,
file_metadata: FileMetadataUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::file_id.eq(self.file_id.to_owned()),
FileMetadataUpdateInternal::from(file_metadata),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "FileMetadata",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_ThemeNew_insert | clm | method | // hyperswitch/crates/diesel_models/src/query/user/theme.rs
// impl for ThemeNew
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Theme> {
generics::generic_insert(conn, self).await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ThemeNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Theme_lineage_filter | clm | method | // hyperswitch/crates/diesel_models/src/query/user/theme.rs
// impl for Theme
fn lineage_filter(
lineage: ThemeLineage,
) -> Box<
dyn diesel::BoxableExpression<<Self as HasTable>::Table, Pg, SqlType = Nullable<Bool>>
+ 'static,
> {
match lineage {
ThemeLineage::Tenant { tenant_id } => Box::new(
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.is_null())
.and(dsl::merchant_id.is_null())
.and(dsl::profile_id.is_null())
.nullable(),
),
ThemeLineage::Organization { tenant_id, org_id } => Box::new(
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::merchant_id.is_null())
.and(dsl::profile_id.is_null()),
),
ThemeLineage::Merchant {
tenant_id,
org_id,
merchant_id,
} => Box::new(
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::merchant_id.eq(merchant_id))
.and(dsl::profile_id.is_null()),
),
ThemeLineage::Profile {
tenant_id,
org_id,
merchant_id,
profile_id,
} => Box::new(
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::merchant_id.eq(merchant_id))
.and(dsl::profile_id.eq(profile_id)),
),
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Theme",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "lineage_filter",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Theme_lineage_hierarchy_filter | clm | method | // hyperswitch/crates/diesel_models/src/query/user/theme.rs
// impl for Theme
fn lineage_hierarchy_filter(
lineage: ThemeLineage,
) -> Box<
dyn diesel::BoxableExpression<<Self as HasTable>::Table, Pg, SqlType = Nullable<Bool>>
+ 'static,
> {
match lineage {
ThemeLineage::Tenant { tenant_id } => Box::new(dsl::tenant_id.eq(tenant_id).nullable()),
ThemeLineage::Organization { tenant_id, org_id } => Box::new(
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.eq(org_id))
.nullable(),
),
ThemeLineage::Merchant {
tenant_id,
org_id,
merchant_id,
} => Box::new(
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::merchant_id.eq(merchant_id))
.nullable(),
),
ThemeLineage::Profile {
tenant_id,
org_id,
merchant_id,
profile_id,
} => Box::new(
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::merchant_id.eq(merchant_id))
.and(dsl::profile_id.eq(profile_id))
.nullable(),
),
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Theme",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "lineage_hierarchy_filter",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Theme_find_by_theme_id | clm | method | // hyperswitch/crates/diesel_models/src/query/user/theme.rs
// impl for Theme
pub async fn find_by_theme_id(conn: &PgPooledConn, theme_id: String) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::theme_id.eq(theme_id),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Theme",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_theme_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Theme_find_most_specific_theme_in_lineage | clm | method | // hyperswitch/crates/diesel_models/src/query/user/theme.rs
// impl for Theme
pub async fn find_most_specific_theme_in_lineage(
conn: &PgPooledConn,
lineage: ThemeLineage,
) -> StorageResult<Self> {
let query = <Self as HasTable>::table().into_boxed();
let query =
lineage
.get_same_and_higher_lineages()
.into_iter()
.fold(query, |mut query, lineage| {
query = query.or_filter(Self::lineage_filter(lineage));
query
});
logger::debug!(query = %debug_query::<Pg,_>(&query).to_string());
let data: Vec<Self> = match track_database_call::<Self, _, _>(
query.get_results_async(conn),
DatabaseOperation::Filter,
)
.await
{
Ok(value) => Ok(value),
Err(err) => match err {
DieselError::NotFound => Err(report!(err)).change_context(DatabaseError::NotFound),
_ => Err(report!(err)).change_context(DatabaseError::Others),
},
}?;
data.into_iter()
.min_by_key(|theme| theme.entity_type)
.ok_or(report!(DatabaseError::NotFound))
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Theme",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_most_specific_theme_in_lineage",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Theme_find_by_lineage | clm | method | // hyperswitch/crates/diesel_models/src/query/user/theme.rs
// impl for Theme
pub async fn find_by_lineage(
conn: &PgPooledConn,
lineage: ThemeLineage,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
Self::lineage_filter(lineage),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Theme",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_by_lineage",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Theme_update_by_theme_id | clm | method | // hyperswitch/crates/diesel_models/src/query/user/theme.rs
// impl for Theme
pub async fn update_by_theme_id(
conn: &PgPooledConn,
theme_id: String,
update: ThemeUpdate,
) -> StorageResult<Self> {
let update_internal: ThemeUpdateInternal = update.into();
let predicate = dsl::theme_id.eq(theme_id);
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(conn, predicate, update_internal)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Theme",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_by_theme_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Theme_delete_by_theme_id_and_lineage | clm | method | // hyperswitch/crates/diesel_models/src/query/user/theme.rs
// impl for Theme
pub async fn delete_by_theme_id_and_lineage(
conn: &PgPooledConn,
theme_id: String,
lineage: ThemeLineage,
) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, _>(
conn,
dsl::theme_id
.eq(theme_id)
.and(Self::lineage_filter(lineage)),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Theme",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "delete_by_theme_id_and_lineage",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Theme_delete_by_theme_id | clm | method | // hyperswitch/crates/diesel_models/src/query/user/theme.rs
// impl for Theme
pub async fn delete_by_theme_id(conn: &PgPooledConn, theme_id: String) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, _>(
conn,
dsl::theme_id.eq(theme_id),
)
.await
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Theme",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "delete_by_theme_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_diesel_models_Theme_find_all_by_lineage_hierarchy | clm | method | // hyperswitch/crates/diesel_models/src/query/user/theme.rs
// impl for Theme
pub async fn find_all_by_lineage_hierarchy(
conn: &PgPooledConn,
lineage: ThemeLineage,
) -> StorageResult<Vec<Self>> {
let filter = Self::lineage_hierarchy_filter(lineage);
let query = <Self as HasTable>::table().filter(filter).into_boxed();
logger::debug!(query = %debug_query::<Pg,_>(&query).to_string());
match track_database_call::<Self, _, _>(
query.get_results_async(conn),
DatabaseOperation::Filter,
)
.await
{
Ok(themes) => Ok(themes),
Err(err) => match err {
DieselError::NotFound => Err(report!(err)).change_context(DatabaseError::NotFound),
_ => Err(report!(err)).change_context(DatabaseError::Others),
},
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Theme",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "find_all_by_lineage_hierarchy",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.