text
stringlengths
70
351k
source
stringclasses
4 values
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/business_profile.rs | crate: router use common_utils::{ext_traits::AsyncExt, types::keymanager::KeyManagerState}; use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, types::{ domain::{ self, behaviour::{Conversion, ReverseConversion}, }, storage, }, }; async fn find_business_profile_by_profile_name_merchant_id( &self, key_manager_state: &KeyManagerState, merchant_key_store: &domain::MerchantKeyStore, profile_name: &str, merchant_id: &common_utils::id_type::MerchantId, ) -> CustomResult<domain::Profile, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/business_profile.rs | crate: router use common_utils::{ext_traits::AsyncExt, types::keymanager::KeyManagerState}; use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, types::{ domain::{ self, behaviour::{Conversion, ReverseConversion}, }, storage, }, }; async fn list_profile_by_merchant_id( &self, key_manager_state: &KeyManagerState, merchant_key_store: &domain::MerchantKeyStore, merchant_id: &common_utils::id_type::MerchantId, ) -> CustomResult<Vec<domain::Profile>, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/business_profile.rs | crate: router use common_utils::{ext_traits::AsyncExt, types::keymanager::KeyManagerState}; use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, types::{ domain::{ self, behaviour::{Conversion, ReverseConversion}, }, storage, }, }; async fn update_profile_by_profile_id( &self, key_manager_state: &KeyManagerState, merchant_key_store: &domain::MerchantKeyStore, current_state: domain::Profile, profile_update: domain::ProfileUpdate, ) -> CustomResult<domain::Profile, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/business_profile.rs | crate: router use common_utils::{ext_traits::AsyncExt, types::keymanager::KeyManagerState}; use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, types::{ domain::{ self, behaviour::{Conversion, ReverseConversion}, }, storage, }, }; async fn find_business_profile_by_merchant_id_profile_id( &self, key_manager_state: &KeyManagerState, merchant_key_store: &domain::MerchantKeyStore, merchant_id: &common_utils::id_type::MerchantId, profile_id: &common_utils::id_type::ProfileId, ) -> CustomResult<domain::Profile, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/business_profile.rs | crate: router use common_utils::{ext_traits::AsyncExt, types::keymanager::KeyManagerState}; use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, types::{ domain::{ self, behaviour::{Conversion, ReverseConversion}, }, storage, }, }; async fn find_business_profile_by_profile_id( &self, key_manager_state: &KeyManagerState, merchant_key_store: &domain::MerchantKeyStore, profile_id: &common_utils::id_type::ProfileId, ) -> CustomResult<domain::Profile, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/business_profile.rs | crate: router use common_utils::{ext_traits::AsyncExt, types::keymanager::KeyManagerState}; use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, types::{ domain::{ self, behaviour::{Conversion, ReverseConversion}, }, storage, }, }; async fn delete_profile_by_profile_id_merchant_id( &self, profile_id: &common_utils::id_type::ProfileId, merchant_id: &common_utils::id_type::MerchantId, ) -> CustomResult<bool, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/business_profile.rs | crate: router use common_utils::{ext_traits::AsyncExt, types::keymanager::KeyManagerState}; use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, types::{ domain::{ self, behaviour::{Conversion, ReverseConversion}, }, storage, }, }; async fn insert_business_profile( &self, key_manager_state: &KeyManagerState, merchant_key_store: &domain::MerchantKeyStore, business_profile: domain::Profile, ) -> CustomResult<domain::Profile, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/payment_link.rs | crate: router use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, services::Store, types::storage::{self, PaymentLinkDbExt}, }; async fn list_payment_link_by_merchant_id( &self, _merchant_id: &common_utils::id_type::MerchantId, _payment_link_constraints: api_models::payments::PaymentLinkListConstraints, ) -> CustomResult<Vec<storage::PaymentLink>, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/payment_link.rs | crate: router use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, services::Store, types::storage::{self, PaymentLinkDbExt}, }; async fn find_payment_link_by_payment_link_id( &self, _payment_link_id: &str, ) -> CustomResult<storage::PaymentLink, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/payment_link.rs | crate: router use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, services::Store, types::storage::{self, PaymentLinkDbExt}, }; async fn insert_payment_link( &self, _payment_link: storage::PaymentLinkNew, ) -> CustomResult<storage::PaymentLink, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/payment_link.rs | crate: router use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, services::Store, types::storage::{self, PaymentLinkDbExt}, }; async fn list_payment_link_by_merchant_id( &self, merchant_id: &common_utils::id_type::MerchantId, payment_link_constraints: api_models::payments::PaymentLinkListConstraints, ) -> CustomResult<Vec<storage::PaymentLink>, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/payment_link.rs | crate: router use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, services::Store, types::storage::{self, PaymentLinkDbExt}, }; async fn insert_payment_link( &self, payment_link_config: storage::PaymentLinkNew, ) -> CustomResult<storage::PaymentLink, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/payment_link.rs | crate: router use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, db::MockDb, services::Store, types::storage::{self, PaymentLinkDbExt}, }; async fn find_payment_link_by_payment_link_id( &self, payment_link_id: &str, ) -> CustomResult<storage::PaymentLink, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/api_keys.rs | crate: router use storage_impl::redis::cache::{self, CacheKind, ACCOUNTS_CACHE}; use super::{MockDb, Store}; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn test_api_keys_cache() { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/api_keys.rs | crate: router use storage_impl::redis::cache::{self, CacheKind, ACCOUNTS_CACHE}; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn list_api_keys_by_merchant_id( &self, merchant_id: &common_utils::id_type::MerchantId, limit: Option<i64>, offset: Option<i64>, ) -> CustomResult<Vec<storage::ApiKey>, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/api_keys.rs | crate: router use storage_impl::redis::cache::{self, CacheKind, ACCOUNTS_CACHE}; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn update_api_key( &self, merchant_id: common_utils::id_type::MerchantId, key_id: common_utils::id_type::ApiKeyId, api_key: storage::ApiKeyUpdate, ) -> CustomResult<storage::ApiKey, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/api_keys.rs | crate: router use error_stack::report; use router_env::{instrument, tracing}; use storage_impl::redis::cache::{self, CacheKind, ACCOUNTS_CACHE}; use super::{MockDb, Store}; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn revoke_api_key( &self, merchant_id: &common_utils::id_type::MerchantId, key_id: &common_utils::id_type::ApiKeyId, ) -> CustomResult<bool, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/api_keys.rs | crate: router use storage_impl::redis::cache::{self, CacheKind, ACCOUNTS_CACHE}; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn find_api_key_by_hash_optional( &self, hashed_api_key: storage::HashedApiKey, ) -> CustomResult<Option<storage::ApiKey>, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/api_keys.rs | crate: router use storage_impl::redis::cache::{self, CacheKind, ACCOUNTS_CACHE}; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn find_api_key_by_merchant_id_key_id_optional( &self, merchant_id: &common_utils::id_type::MerchantId, key_id: &common_utils::id_type::ApiKeyId, ) -> CustomResult<Option<storage::ApiKey>, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/api_keys.rs | crate: router use error_stack::report; use storage_impl::redis::cache::{self, CacheKind, ACCOUNTS_CACHE}; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn insert_api_key( &self, api_key: storage::ApiKeyNew, ) -> CustomResult<storage::ApiKey, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/api_keys.rs | crate: router use super::{MockDb, Store}; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn test_mockdb_api_key_interface() { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/gsm.rs | crate: router use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn delete_gsm_rule( &self, _connector: String, _flow: String, _sub_flow: String, _code: String, _message: String, ) -> CustomResult<bool, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/gsm.rs | crate: router use diesel_models::gsm as storage; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn update_gsm_rule( &self, _connector: String, _flow: String, _sub_flow: String, _code: String, _message: String, _data: storage::GatewayStatusMappingUpdate, ) -> CustomResult<storage::GatewayStatusMap, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/gsm.rs | crate: router use diesel_models::gsm as storage; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn find_gsm_rule( &self, _connector: String, _flow: String, _sub_flow: String, _code: String, _message: String, ) -> CustomResult<storage::GatewayStatusMap, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/gsm.rs | crate: router use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn find_gsm_decision( &self, _connector: String, _flow: String, _sub_flow: String, _code: String, _message: String, ) -> CustomResult<String, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/gsm.rs | crate: router use diesel_models::gsm as storage; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn add_gsm_rule( &self, _rule: storage::GatewayStatusMappingNew, ) -> CustomResult<storage::GatewayStatusMap, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/gsm.rs | crate: router use diesel_models::gsm as storage; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn delete_gsm_rule( &self, connector: String, flow: String, sub_flow: String, code: String, message: String, ) -> CustomResult<bool, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/gsm.rs | crate: router use diesel_models::gsm as storage; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn update_gsm_rule( &self, connector: String, flow: String, sub_flow: String, code: String, message: String, data: storage::GatewayStatusMappingUpdate, ) -> CustomResult<storage::GatewayStatusMap, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch/crates/router/src/db/gsm.rs | crate: router use diesel_models::gsm as storage; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn find_gsm_rule( &self, connector: String, flow: String, sub_flow: String, code: String, message: String, ) -> CustomResult<storage::GatewayStatusMap, errors::StorageError> { let conn = connection::pg_connection_read(self).await?; storage::GatewayStatusMap::find(&conn, connector, flow, sub_flow, code, message) .await .map_err(|error| report!(errors::StorageError::from(error))) }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/gsm.rs | crate: router use diesel_models::gsm as storage; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn find_gsm_decision( &self, connector: String, flow: String, sub_flow: String, code: String, message: String, ) -> CustomResult<String, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch/crates/router/src/db/authentication.rs | crate: router use diesel_models::authentication::AuthenticationUpdateInternal; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn update_authentication_by_merchant_id_authentication_id( &self, previous_state: storage::Authentication, authentication_update: storage::AuthenticationUpdate, ) -> CustomResult<storage::Authentication, errors::StorageError> { let mut authentications = self.authentications.lock().await; let authentication_id = previous_state.authentication_id.clone(); let merchant_id = previous_state.merchant_id.clone(); authentications .iter_mut() .find(|authentication| authentication.authentication_id == authentication_id && authentication.merchant_id == merchant_id) .map(|authentication| { let authentication_update_internal = AuthenticationUpdateInternal::from(authentication_update); let updated_authentication = authentication_update_internal.apply_changeset(previous_state); *authentication = updated_authentication.clone(); updated_authentication }) .ok_or( errors::StorageError::ValueNotFound(format!( "cannot find authentication for authentication_id = {authentication_id} and merchant_id = {merchant_id:?}" )) .into(), ) }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/authentication.rs | crate: router use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn find_authentication_by_merchant_id_connector_authentication_id( &self, _merchant_id: common_utils::id_type::MerchantId, _connector_authentication_id: String, ) -> CustomResult<storage::Authentication, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/authentication.rs | crate: router use diesel_models::authentication::AuthenticationUpdateInternal; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn find_authentication_by_merchant_id_authentication_id( &self, merchant_id: &common_utils::id_type::MerchantId, authentication_id: String, ) -> CustomResult<storage::Authentication, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/authentication.rs | crate: router use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn update_authentication_by_merchant_id_authentication_id( &self, previous_state: storage::Authentication, authentication_update: storage::AuthenticationUpdate, ) -> CustomResult<storage::Authentication, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/authentication.rs | crate: router use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn find_authentication_by_merchant_id_connector_authentication_id( &self, merchant_id: common_utils::id_type::MerchantId, connector_authentication_id: String, ) -> CustomResult<storage::Authentication, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/authentication.rs | crate: router use diesel_models::authentication::AuthenticationUpdateInternal; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn insert_authentication( &self, authentication: storage::AuthenticationNew, ) -> CustomResult<storage::Authentication, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user_key_store.rs | crate: router use common_utils::{ errors::CustomResult, types::keymanager::{self, KeyManagerState}, }; use masking::Secret; use crate::{ connection, core::errors, services::Store, types::domain::{ self, behaviour::{Conversion, ReverseConversion}, }, }; async fn get_user_key_store_by_user_id( &self, state: &KeyManagerState, user_id: &str, key: &Secret<Vec<u8>>, ) -> CustomResult<domain::UserKeyStore, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user_key_store.rs | crate: router use common_utils::{ errors::CustomResult, types::keymanager::{self, KeyManagerState}, }; use masking::Secret; use crate::{ connection, core::errors, services::Store, types::domain::{ self, behaviour::{Conversion, ReverseConversion}, }, }; async fn get_all_user_key_store( &self, state: &KeyManagerState, key: &Secret<Vec<u8>>, _from: u32, _limit: u32, ) -> CustomResult<Vec<domain::UserKeyStore>, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user_key_store.rs | crate: router use common_utils::{ errors::CustomResult, types::keymanager::{self, KeyManagerState}, }; use error_stack::{report, ResultExt}; use masking::Secret; use crate::{ connection, core::errors, services::Store, types::domain::{ self, behaviour::{Conversion, ReverseConversion}, }, }; async fn get_all_user_key_store( &self, state: &KeyManagerState, key: &Secret<Vec<u8>>, from: u32, limit: u32, ) -> CustomResult<Vec<domain::UserKeyStore>, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/reverse_lookup.rs | crate: router use crate::{ errors::{self, CustomResult}, types::storage::{ enums, reverse_lookup::{ReverseLookup, ReverseLookupNew}, }, }; async fn get_lookup_by_lookup_id( &self, id: &str, storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult<ReverseLookup, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/reverse_lookup.rs | crate: router use crate::{ errors::{self, CustomResult}, types::storage::{ enums, reverse_lookup::{ReverseLookup, ReverseLookupNew}, }, }; async fn insert_reverse_lookup( &self, new: ReverseLookupNew, storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult<ReverseLookup, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/reverse_lookup.rs | crate: router use crate::{ errors::{self, CustomResult}, types::storage::{ enums, reverse_lookup::{ReverseLookup, ReverseLookupNew}, }, }; async fn get_lookup_by_lookup_id( &self, lookup_id: &str, _storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult<ReverseLookup, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/reverse_lookup.rs | crate: router use crate::{ errors::{self, CustomResult}, types::storage::{ enums, reverse_lookup::{ReverseLookup, ReverseLookupNew}, }, }; async fn insert_reverse_lookup( &self, new: ReverseLookupNew, _storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult<ReverseLookup, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/reverse_lookup.rs | crate: router use crate::{ errors::{self, CustomResult}, types::storage::{ enums, reverse_lookup::{ReverseLookup, ReverseLookupNew}, }, }; async fn get_lookup_by_lookup_id( &self, id: &str, _storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult<ReverseLookup, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/capture.rs | crate: router use crate::{ core::errors::{self, CustomResult}, types::storage::{self as types, enums}, }; async fn insert_capture( &self, capture: types::CaptureNew, _storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult<types::Capture, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/capture.rs | crate: router use super::MockDb; use crate::{ core::errors::{self, CustomResult}, types::storage::{self as types, enums}, }; async fn find_all_captures_by_merchant_id_payment_id_authorized_attempt_id( &self, _merchant_id: &common_utils::id_type::MerchantId, _payment_id: &common_utils::id_type::PaymentId, _authorized_attempt_id: &str, _storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult<Vec<types::Capture>, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/capture.rs | crate: router use super::MockDb; use crate::{ core::errors::{self, CustomResult}, types::storage::{self as types, enums}, }; async fn update_capture_with_capture_id( &self, _this: types::Capture, _capture: types::CaptureUpdate, _storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult<types::Capture, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/capture.rs | crate: router use crate::{ core::errors::{self, CustomResult}, types::storage::{self as types, enums}, }; async fn find_all_captures_by_merchant_id_payment_id_authorized_attempt_id( &self, merchant_id: &common_utils::id_type::MerchantId, payment_id: &common_utils::id_type::PaymentId, authorized_attempt_id: &str, _storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult<Vec<Capture>, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/capture.rs | crate: router use crate::{ core::errors::{self, CustomResult}, types::storage::{self as types, enums}, }; async fn update_capture_with_capture_id( &self, this: Capture, capture: CaptureUpdate, _storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult<Capture, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/capture.rs | crate: router use crate::{ core::errors::{self, CustomResult}, types::storage::{self as types, enums}, }; async fn insert_capture( &self, capture: CaptureNew, _storage_scheme: enums::MerchantStorageScheme, ) -> CustomResult<Capture, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/authorization.rs | crate: router use diesel_models::authorization::AuthorizationUpdateInternal; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn update_authorization_by_merchant_id_authorization_id( &self, merchant_id: common_utils::id_type::MerchantId, authorization_id: String, authorization_update: storage::AuthorizationUpdate, ) -> CustomResult<storage::Authorization, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/authorization.rs | crate: router use diesel_models::authorization::AuthorizationUpdateInternal; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn update_authorization_by_merchant_id_authorization_id( &self, merchant_id: common_utils::id_type::MerchantId, authorization_id: String, authorization: storage::AuthorizationUpdate, ) -> CustomResult<storage::Authorization, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/authorization.rs | crate: router use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn find_all_authorizations_by_merchant_id_payment_id( &self, merchant_id: &common_utils::id_type::MerchantId, payment_id: &common_utils::id_type::PaymentId, ) -> CustomResult<Vec<storage::Authorization>, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch/crates/router/src/db/authorization.rs | crate: router use diesel_models::authorization::AuthorizationUpdateInternal; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, types::storage, }; async fn insert_authorization( &self, authorization: storage::AuthorizationNew, ) -> CustomResult<storage::Authorization, errors::StorageError> { let conn = connection::pg_connection_write(self).await?; authorization .insert(&conn) .await .map_err(|error| report!(errors::StorageError::from(error))) }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user_authentication_method.rs | crate: router use diesel_models::user_authentication_method as storage; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn insert_user_authentication_method( &self, user_authentication_method: storage::UserAuthenticationMethodNew, ) -> CustomResult<storage::UserAuthenticationMethod, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user_authentication_method.rs | crate: router use diesel_models::user_authentication_method as storage; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn list_user_authentication_methods_for_owner_id( &self, owner_id: &str, ) -> CustomResult<Vec<storage::UserAuthenticationMethod>, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user_authentication_method.rs | crate: router use diesel_models::user_authentication_method as storage; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn get_user_authentication_method_by_id( &self, id: &str, ) -> CustomResult<storage::UserAuthenticationMethod, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user_authentication_method.rs | crate: router use diesel_models::user_authentication_method as storage; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn list_user_authentication_methods_for_email_domain( &self, email_domain: &str, ) -> CustomResult<Vec<storage::UserAuthenticationMethod>, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user_authentication_method.rs | crate: router use diesel_models::user_authentication_method as storage; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn list_user_authentication_methods_for_auth_id( &self, auth_id: &str, ) -> CustomResult<Vec<storage::UserAuthenticationMethod>, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user/theme.rs | crate: router use common_utils::types::theme::ThemeLineage; use diesel_models::user::theme as storage; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn insert_theme( &self, new_theme: storage::ThemeNew, ) -> CustomResult<storage::Theme, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user/theme.rs | crate: router use common_utils::types::theme::ThemeLineage; use diesel_models::user::theme as storage; fn check_theme_with_lineage(theme: &storage::Theme, lineage: &ThemeLineage) -> bool { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user/theme.rs | crate: router use common_utils::types::theme::ThemeLineage; use diesel_models::user::theme as storage; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn delete_theme_by_lineage_and_theme_id( &self, theme_id: String, lineage: ThemeLineage, ) -> CustomResult<storage::Theme, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch/crates/router/src/db/user/theme.rs | crate: router use common_utils::types::theme::ThemeLineage; use diesel_models::user::theme as storage; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn find_theme_by_lineage( &self, lineage: ThemeLineage, ) -> CustomResult<storage::Theme, errors::StorageError> { let themes = self.themes.lock().await; themes .iter() .find(|theme| check_theme_with_lineage(theme, &lineage)) .cloned() .ok_or( errors::StorageError::ValueNotFound(format!( "Theme with lineage {:?} not found", lineage )) .into(), ) }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user/theme.rs | crate: router use common_utils::types::theme::ThemeLineage; use diesel_models::user::theme as storage; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn find_most_specific_theme_in_lineage( &self, lineage: ThemeLineage, ) -> CustomResult<storage::Theme, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user/theme.rs | crate: router use common_utils::types::theme::ThemeLineage; use diesel_models::user::theme as storage; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn find_theme_by_theme_id( &self, theme_id: String, ) -> CustomResult<storage::Theme, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user/theme.rs | crate: router use common_utils::types::theme::ThemeLineage; use diesel_models::user::theme as storage; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn find_theme_by_lineage( &self, lineage: ThemeLineage, ) -> CustomResult<storage::Theme, errors::StorageError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
// file: hyperswitch/crates/router/src/db/user/theme.rs | crate: router use common_utils::types::theme::ThemeLineage; use diesel_models::user::theme as storage; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn find_most_specific_theme_in_lineage( &self, lineage: ThemeLineage, ) -> CustomResult<storage::Theme, errors::StorageError> { let conn = connection::pg_connection_read(self).await?; storage::Theme::find_most_specific_theme_in_lineage(&conn, lineage) .await .map_err(|error| report!(errors::StorageError::from(error))) }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/db/user/theme.rs | crate: router use common_utils::types::theme::ThemeLineage; use diesel_models::user::theme as storage; use error_stack::report; use crate::{ connection, core::errors::{self, CustomResult}, services::Store, }; async fn insert_theme( &self, theme: storage::ThemeNew, ) -> CustomResult<storage::Theme, errors::StorageError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/events/audit_events.rs | crate: router fn class(&self) -> Self::EventType { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/events/audit_events.rs | crate: router fn identifier(&self) -> String { { AuditEventType::Error { .. } => "error", AuditEventType::PaymentCreated => "payment_created", AuditEventType::PaymentConfirm { .. } => "payment_confirm", AuditEventType::ConnectorDecided => "connector_decided",<|fim_suffix|> <|fim_middle|> AuditEventType::PaymentCreate => "payment_create", AuditEventType::PaymentStatus => "payment_status", AuditEventType::PaymentCompleteAuthorize => "payment_complete_authorize", AuditEventType::PaymentReject { .. } => "payment_rejected", } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/events/audit_events.rs | crate: router use time::PrimitiveDateTime; fn timestamp(&self) -> PrimitiveDateTime { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/events/audit_events.rs | crate: router use common_utils::types::MinorUnit; pub fn new(event_type: AuditEventType) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/events/connector_api_logs.rs | crate: router use super::EventType; fn event_type(&self) -> EventType { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/cache.rs | crate: router use actix_web::{web, HttpRequest, Responder}; use router_env::{instrument, tracing, Flow}; use super::AppState; use crate::{ core::{api_locking, cache}, services::{api, authentication as auth}, }; pub async fn invalidate( state: web::Data<AppState>, req: HttpRequest, key: web::Path<String>, ) -> impl Responder { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/locker_migration.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::Flow; use super::AppState; use crate::{ core::{api_locking, locker_migration}, services::{api, authentication as auth}, }; pub async fn rust_locker_migration( state: web::Data<AppState>, req: HttpRequest, path: web::Path<common_utils::id_type::MerchantId>, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/hypersense.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use api_models::external_service_auth as external_service_auth_api; use router_env::Flow; use super::AppState; use crate::{ core::{api_locking, external_service_auth}, services::{ api, authentication::{self, ExternalServiceType}, }, }; pub async fn verify_hypersense_token( state: web::Data<AppState>, http_req: HttpRequest, json_payload: web::Json<external_service_auth_api::ExternalVerifyTokenRequest>, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/hypersense.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use api_models::external_service_auth as external_service_auth_api; use router_env::Flow; use super::AppState; use crate::{ core::{api_locking, external_service_auth}, services::{ api, authentication::{self, ExternalServiceType}, }, }; pub async fn signout_hypersense_token( state: web::Data<AppState>, http_req: HttpRequest, json_payload: web::Json<external_service_auth_api::ExternalSignoutTokenRequest>, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/hypersense.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use api_models::external_service_auth as external_service_auth_api; use router_env::Flow; use super::AppState; use crate::{ core::{api_locking, external_service_auth}, services::{ api, authentication::{self, ExternalServiceType}, }, }; pub async fn get_hypersense_token(state: web::Data<AppState>, req: HttpRequest) -> HttpResponse { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn get_refunds_aggregate_profile( state: web::Data<AppState>, req: HttpRequest, query_params: web::Query<common_utils::types::TimeRange>, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn get_refunds_aggregates( state: web::Data<AppState>, req: HttpRequest, query_params: web::Query<common_utils::types::TimeRange>, ) -> HttpResponse { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn get_refunds_filters_profile( state: web::Data<AppState>, req: HttpRequest, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn refunds_list_profile( state: web::Data<AppState>, req: HttpRequest, payload: web::Json<api_models::refunds::RefundListRequest>, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn refunds_retrieve_with_body( state: web::Data<AppState>, req: HttpRequest, json_payload: web::Json<refunds::RefundsRetrieveRequest>, ) -> HttpResponse { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn refunds_retrieve( state: web::Data<AppState>, req: HttpRequest, path: web::Path<String>, query_params: web::Query<api_models::refunds::RefundsRetrieveBody>, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn refunds_create( state: web::Data<AppState>, req: HttpRequest, json_payload: web::Json<refunds::RefundRequest>, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn refunds_manual_update( state: web::Data<AppState>, req: HttpRequest, payload: web::Json<api_models::refunds::RefundManualUpdateRequest>, path: web::Path<String>, ) -> HttpResponse { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn get_refunds_filters(state: web::Data<AppState>, req: HttpRequest) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn refunds_filter_list( state: web::Data<AppState>, req: HttpRequest, payload: web::Json<common_utils::types::TimeRange>, ) -> HttpResponse { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn refunds_list( state: web::Data<AppState>, req: HttpRequest, payload: web::Json<api_models::refunds::RefundListRequest>, ) -> HttpResponse { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/refunds.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, refunds::*}, services::{api, authentication as auth, authorization::permissions::Permission}, types::api::refunds, }; pub async fn refunds_update( state: web::Data<AppState>, req: HttpRequest, json_payload: web::Json<refunds::RefundUpdateRequest>, path: web::Path<String>, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/health.rs | crate: router use actix_web::{web, HttpRequest}; use router_env::{instrument, logger, tracing, Flow}; use super::app; use crate::{ core::{api_locking, health_check::HealthCheckInterface}, errors::{self, RouterResponse}, routes::metrics, services::{api, authentication as auth}, }; pub async fn deep_health_check( state: web::Data<app::AppState>, request: HttpRequest, ) -> impl actix_web::Responder { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/health.rs | crate: router use api_models::health_check::RouterHealthCheckResponse; use router_env::{instrument, logger, tracing, Flow}; use super::app; use crate::{ core::{api_locking, health_check::HealthCheckInterface}, errors::{self, RouterResponse}, routes::metrics, services::{api, authentication as auth}, }; async fn deep_health_check_func( state: app::SessionState, ) -> RouterResponse<RouterHealthCheckResponse> { {logger::info!("Deep health check was called");<|fim_suffix|> <|fim_middle|> Ok(api::ApplicationResponse::Json(response))}}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/fraud_check.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use router_env::Flow; use crate::{ core::{api_locking, fraud_check as frm_core}, services::{self, api}, AppState, }; pub async fn frm_fulfillment( state: web::Data<AppState>, req: HttpRequest, json_payload: web::Json<frm_core::types::FrmFulfillmentRequest>, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/configs.rs | crate: router use actix_web::{web, HttpRequest, Responder}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, configs}, services::{api, authentication as auth}, types::api as api_types, }; pub async fn config_key_delete( state: web::Data<AppState>, req: HttpRequest, path: web::Path<String>, ) -> impl Responder { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/configs.rs | crate: router use actix_web::{web, HttpRequest, Responder}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, configs}, services::{api, authentication as auth}, types::api as api_types, }; pub async fn config_key_update( state: web::Data<AppState>, req: HttpRequest, path: web::Path<String>, json_payload: web::Json<api_types::ConfigUpdate>, ) -> impl Responder { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/configs.rs | crate: router use actix_web::{web, HttpRequest, Responder}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, configs}, services::{api, authentication as auth}, types::api as api_types, }; pub async fn config_key_retrieve( state: web::Data<AppState>, req: HttpRequest, path: web::Path<String>, ) -> impl Responder { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/configs.rs | crate: router use actix_web::{web, HttpRequest, Responder}; use router_env::{instrument, tracing, Flow}; use super::app::AppState; use crate::{ core::{api_locking, configs}, services::{api, authentication as auth}, types::api as api_types, }; pub async fn config_key_create( state: web::Data<AppState>, req: HttpRequest, json_payload: web::Json<api_types::Config>, ) -> impl Responder { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/payout_link.rs | crate: router use actix_web::{web, Responder}; use api_models::payouts::PayoutLinkInitiateRequest; use router_env::Flow; use crate::{ core::{api_locking, payout_link::*}, services::{ api, authentication::{self as auth}, }, AppState, }; pub async fn render_payout_link( state: web::Data<AppState>, req: actix_web::HttpRequest, path: web::Path<(common_utils::id_type::MerchantId, String)>, ) -> impl Responder { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/disputes.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use api_models::disputes as dispute_models; use router_env::{instrument, tracing, Flow}; use crate::{core::api_locking, services::authorization::permissions::Permission}; use super::app::AppState; use crate::{ core::disputes, services::{api, authentication as auth}, types::api::disputes as dispute_types, }; pub async fn get_disputes_aggregate_profile( state: web::Data<AppState>, req: HttpRequest, query_param: web::Query<common_utils::types::TimeRange>, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/router/src/routes/disputes.rs | crate: router use actix_web::{web, HttpRequest, HttpResponse}; use api_models::disputes as dispute_models; use router_env::{instrument, tracing, Flow}; use crate::{core::api_locking, services::authorization::permissions::Permission}; use super::app::AppState; use crate::{ core::disputes, services::{api, authentication as auth}, types::api::disputes as dispute_types, }; pub async fn get_disputes_aggregate( state: web::Data<AppState>, req: HttpRequest, query_param: web::Query<common_utils::types::TimeRange>, ) -> HttpResponse { <|fim_suffix|> <|fim_middle|> }
ast_fragments