text
stringlengths
70
351k
source
stringclasses
4 values
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_connectors/src/connectors/bamboraapac/transformers.rs | crate: hyperswitch_connectors | connector: bamboraapac use common_enums::enums; use hyperswitch_domain_models::{ payment_method_data::PaymentMethodData, router_data::{ConnectorAuthType, ErrorResponse, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_connectors/src/connectors/bamboraapac/transformers.rs | crate: hyperswitch_connectors | connector: bamboraapac use common_enums::enums; use hyperswitch_domain_models::{ payment_method_data::PaymentMethodData, router_data::{ConnectorAuthType, ErrorResponse, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs | crate: hyperswitch_connectors | connector: amazonpay use hyperswitch_domain_models::{ payment_method_data::PaymentMethodData, router_data::{ConnectorAuthType, RouterData}, router_flow_types::refunds:...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs | crate: hyperswitch_connectors | connector: amazonpay use hyperswitch_domain_models::{ payment_method_data::PaymentMethodData, router_data::{ConnectorAuthType, RouterData}, router_flow_types::refunds:...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs | crate: hyperswitch_connectors | connector: amazonpay use common_enums::enums; use hyperswitch_domain_models::{ payment_method_data::PaymentMethodData, router_data::{ConnectorAuthType, RouterData}, ro...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs | crate: hyperswitch_connectors | connector: amazonpay fn from(item: AmazonpayPaymentStatus) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs | crate: hyperswitch_connectors | connector: amazonpay use hyperswitch_domain_models::{ payment_method_data::PaymentMethodData, router_data::{ConnectorAuthType, RouterData}, router_flow_types::refunds:...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/benches/encryption_bench.rs | crate: benches use cripta::{ app::AppState, config, core::{crypto::custodian::Custodian, datakey::create::generate_and_create_data_key}, multitenancy::TenantId, types::{ core::{DecryptedData, DecryptedDataGr...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/benches/encryption_bench.rs | crate: benches use cripta::{ app::AppState, config, core::{crypto::custodian::Custodian, datakey::create::generate_and_create_data_key}, multitenancy::TenantId, types::{ core::{DecryptedData, DecryptedDataGr...
ast_fragments
// file: hyperswitch-encryption-service/benches/encryption_bench.rs | crate: benches use cripta::{ app::AppState, config, core::{crypto::custodian::Custodian, datakey::create::generate_and_create_data_key}, multitenancy::TenantId, types::{ core::{DecryptedData, DecryptedDataGroup, Identifier...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/benches/encryption_bench.rs | crate: benches use cripta::{ app::AppState, config, core::{crypto::custodian::Custodian, datakey::create::generate_and_create_data_key}, multitenancy::TenantId, types::{ core::{DecryptedData, DecryptedDataGr...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/method.rs | crate: src use crate::{ core::{custodian::Custodian, DataDecrypter, DataEncrypter}, errors, multitenancy::TenantState, types::Identifier, }; pub async fn encrypt( self, state: &TenantState, identifier: &...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/method.rs | crate: src use crate::{ core::{custodian::Custodian, DataDecrypter, DataEncrypter}, errors, multitenancy::TenantState, types::Identifier, }; pub async fn encrypt( self, state: &TenantState, identifier: &...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/method.rs | crate: src use crate::{ core::{custodian::Custodian, DataDecrypter, DataEncrypter}, errors, multitenancy::TenantState, types::Identifier, }; pub async fn decrypt( self, state: &TenantState, identifier: &...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src use crate::{ core::KeyDecrypter, crypto::Source, env::observability as logger, errors::{self, SwitchError}, multitenancy::TenantState, storage::{cache, dek::DataKeyStorageInterface}, types::Identifier, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src { type Row = i32; fn build(row: Self::Row) -> deserialize::Result<Self> { Ok(Self::from(row)) } } impl<'frame, 'metadata> DeserializeValue<'frame, 'metadata> for Version { fn type_check(typ: &ColumnType<'_...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src #[derive(AsExpression, Eq, PartialEq, Debug, Clone, Copy, Hash)] #[diesel(sql_type = diesel::sql_types::Integer)] pub struct Version(i32); impl Display for Version { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src use diesel::{ backend::Backend, deserialize::{self, FromSql}, expression::AsExpression, serialize::ToSql, sql_types, Queryable, }; use masking::{Deserialize, Serialize}; use scylla::{ deserialize::{Deserial...
ast_fragments
// file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src use crate::{ core::KeyDecrypter, crypto::Source, env::observability as logger, errors::{self, SwitchError}, multitenancy::TenantState, storage::{cache, dek::DataKeyStorageInterface}, types::Identifier, }; use diesel::...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src use diesel::{ backend::Backend, deserialize::{self, FromSql}, expression::AsExpression, serialize::ToSql, sql_types, Queryable, }; use charybdis::scylla::SerializeValue; use scylla::{ deserialize::{Deserial...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src fn from(v: i32) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src use crate::{ core::KeyDecrypter, crypto::Source, env::observability as logger, errors::{self, SwitchError}, multitenancy::TenantState, storage::{cache, dek::DataKeyStorageInterface}, types::Identifier, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src use crate::{ core::KeyDecrypter, crypto::Source, env::observability as logger, errors::{self, SwitchError}, multitenancy::TenantState, storage::{cache, dek::DataKeyStorageInterface}, types::Identifier, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src use crate::{ core::KeyDecrypter, crypto::Source, env::observability as logger, errors::{self, SwitchError}, multitenancy::TenantState, storage::{cache, dek::DataKeyStorageInterface}, types::Identifier, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src use crate::{ core::KeyDecrypter, crypto::Source, env::observability as logger, errors::{self, SwitchError}, multitenancy::TenantState, storage::{cache, dek::DataKeyStorageInterface}, types::Identifier, ...
ast_fragments
// file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src use crate::{ core::KeyDecrypter, crypto::Source, env::observability as logger, errors::{self, SwitchError}, multitenancy::TenantState, storage::{cache, dek::DataKeyStorageInterface}, types::Identifier, }; use diesel::...
ast_fragments
// file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src use crate::{ core::KeyDecrypter, crypto::Source, env::observability as logger, errors::{self, SwitchError}, multitenancy::TenantState, storage::{cache, dek::DataKeyStorageInterface}, types::Identifier, }; use core::fm...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/key.rs | crate: src use crate::{ core::KeyDecrypter, crypto::Source, env::observability as logger, errors::{self, SwitchError}, multitenancy::TenantState, storage::{cache, dek::DataKeyStorageInterface}, types::Identifier, ...
ast_fragments
// file: hyperswitch-encryption-service/src/types/core/data.rs | crate: src use crate::{consts::base64::BASE64_ENGINE, types::key::Version}; use masking::PeekInterface; use serde::{ de::{self, Deserialize, Deserializer, Unexpected, Visitor}, Serialize, }; use std::fmt; fn deserialize<D>(deserializer: D) -> Resu...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/data.rs | crate: src use crate::{consts::base64::BASE64_ENGINE, types::key::Version}; use masking::PeekInterface; use serde::{ de::{self, Deserialize, Deserializer, Unexpected, Visitor}, Serialize, }; fn visit_str<E>(self, value: &str) -> Res...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/data.rs | crate: src use crate::{consts::base64::BASE64_ENGINE, types::key::Version}; use masking::PeekInterface; use serde::{ de::{self, Deserialize, Deserializer, Unexpected, Visitor}, Serialize, }; fn test_data_deserialize() { {<|fim_suffi...
ast_fragments
// file: hyperswitch-encryption-service/src/types/core/data.rs | crate: src use crate::{consts::base64::BASE64_ENGINE, types::key::Version}; use masking::PeekInterface; use serde::{ de::{self, Deserialize, Deserializer, Unexpected, Visitor}, Serialize, }; fn test_data_deserialize() { #[derive(PartialEq,...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/data.rs | crate: src use crate::{consts::base64::BASE64_ENGINE, types::key::Version}; use serde::{ de::{self, Deserialize, Deserializer, Unexpected, Visitor}, Serialize, }; fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> ...
ast_fragments
// file: hyperswitch-encryption-service/src/types/core/data.rs | crate: src use masking::PeekInterface; use serde::{ de::{self, Deserialize, Deserializer, Unexpected, Visitor}, Serialize, }; pub fn inner(self) -> masking::StrongSecret<Vec<u8>> { self.data }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/data.rs | crate: src use masking::PeekInterface; use serde::{ de::{self, Deserialize, Deserializer, Unexpected, Visitor}, Serialize, }; pub fn inner(self) -> masking::StrongSecret<Vec<u8>> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/data.rs | crate: src use masking::PeekInterface; pub fn from_data(data: masking::StrongSecret<Vec<u8>>) -> Self { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/identifier.rs | crate: src use crate::errors; fn try_from(value: (String, String)) -> Result<Self, Self::Error> { { ("User", kid) => Ok(Self::User(kid)),<|fim_suffix|> <|fim_middle|> (_, _) => Err(error_stack::Report::from( errors::Pa...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/identifier.rs | crate: src pub fn get_identifier(&self) -> (String, String) { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/identifier.rs | crate: src use crate::errors; fn try_from(value: (String, String)) -> Result<Self, Self::Error> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/types/core/identifier.rs | crate: src pub fn is_entity(&self) -> bool { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch-encryption-service/src/types/core/identifier.rs | crate: src pub fn get_identifier(&self) -> (String, String) { match self { Self::User(id) => (String::from("User"), id.clone()), Self::Merchant(id) => (String::from("Merchant"), id.clone()), Self::UserAuth...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/core/datakey.rs | crate: src use crate::{ core::custodian::Custodian, env::observability as logger, errors::{self, ToContainerError}, metrics, multitenancy::TenantState, types::{ requests::{CreateDataKeyRequest, RotateDataKeyRequ...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/core/datakey.rs | crate: src use crate::{ core::custodian::Custodian, env::observability as logger, errors::{self, ToContainerError}, metrics, multitenancy::TenantState, types::{ requests::{CreateDataKeyRequest, RotateDataKeyRequ...
ast_fragments
// file: hyperswitch-encryption-service/src/core/datakey.rs | crate: src use crate::{ core::custodian::Custodian, env::observability as logger, errors::{self, ToContainerError}, metrics, multitenancy::TenantState, types::{ requests::{CreateDataKeyRequest, RotateDataKeyRequest, TransferKe...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/core/datakey.rs | crate: src use crate::{ core::custodian::Custodian, env::observability as logger, errors::{self, ToContainerError}, metrics, multitenancy::TenantState, types::{ requests::{CreateDataKeyRequest, RotateDataKeyRequ...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/core/metrics.rs | crate: src use crate::{ app::AppState, errors::{self, ToContainerError}, }; use axum::extract::State; use prometheus::{default_registry, Encoder, TextEncoder}; use std::{io::BufWriter, sync::Arc}; pub async fn gather(State(_): State<Ar...
ast_fragments
// file: hyperswitch-encryption-service/src/core/metrics.rs | crate: src use crate::{ app::AppState, errors::{self, ToContainerError}, }; use axum::extract::State; use prometheus::{default_registry, Encoder, TextEncoder}; use std::{io::BufWriter, sync::Arc}; pub async fn gather(State(_): State<Arc<AppState>>) -...
ast_fragments
// file: hyperswitch-encryption-service/src/core/datakey/create.rs | crate: src use crate::{ core::{crypto::KeyEncrypter, custodian::Custodian}, env::observability as logger, errors::{self, SwitchError}, multitenancy::TenantState, storage::dek::DataKeyStorageInterface, types::{key::Version, requ...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/core/datakey/create.rs | crate: src use crate::{ core::{crypto::KeyEncrypter, custodian::Custodian}, env::observability as logger, errors::{self, SwitchError}, multitenancy::TenantState, storage::dek::DataKeyStorageInterface, types::{key...
ast_fragments
// file: hyperswitch-encryption-service/src/core/datakey/transfer.rs | crate: src use error_stack::ResultExt; use crate::{ consts::base64::BASE64_ENGINE, core::{crypto::KeyEncrypter, custodian::Custodian}, crypto::Source, env::observability as logger, errors::{self, SwitchError}, multitenancy::T...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/core/datakey/transfer.rs | crate: src use error_stack::ResultExt; use crate::{ consts::base64::BASE64_ENGINE, core::{crypto::KeyEncrypter, custodian::Custodian}, crypto::Source, env::observability as logger, errors::{self, SwitchError}, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/storage/cache.rs | crate: src pub use core::*; pub use statics::*; use crate::multitenancy::TenantState; pub fn from_state(tenant: &TenantState, key: String) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/storage/cache.rs | crate: src pub use core::*; pub use statics::*; pub async fn get(&self, key: &Key) -> Option<V> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/storage/cache.rs | crate: src pub use core::*; pub use statics::*; pub async fn push(&self, key: Key, val: V) { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/storage/cache.rs | crate: src use moka::future::Cache as MokCache; fn new(time_to_live: u64, time_to_idle: u64, max_capacity: Option<u64>) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
// file: hyperswitch-encryption-service/src/storage/cache.rs | crate: src pub use core::*; pub use statics::*; use crate::multitenancy::TenantState; pub fn from_state(tenant: &TenantState, key: String) -> Self { Self { prefix: tenant.cache_prefix.clone(), key, } }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/storage/cache/core.rs | crate: src use crate::{ errors, multitenancy::TenantState, storage::cache::{Cache, Key}, }; pub async fn get_or_populate_cache<T, Fut>( tenant: &TenantState, key: String, cache: &Cache<T>, f: Fut, ) -> errors:...
ast_fragments
// file: hyperswitch-encryption-service/src/storage/cache/core.rs | crate: src use crate::{ errors, multitenancy::TenantState, storage::cache::{Cache, Key}, }; pub async fn get_or_populate_cache<T, Fut>( tenant: &TenantState, key: String, cache: &Cache<T>, f: Fut, ) -> errors::CustomResult<T...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/env/observability.rs | crate: src use super::{ logger::{self, LogGuard}, metrics::{self, MetricsGuard}, }; pub use super::logger::{LogConfig, LogLevel, OnRequest, OnResponse}; pub use tracing::{debug, error, info, trace, warn}; pub fn setup(log_config: ...
ast_fragments
// file: hyperswitch-encryption-service/src/env/observability.rs | crate: src use super::{ logger::{self, LogGuard}, metrics::{self, MetricsGuard}, }; pub use super::logger::{LogConfig, LogLevel, OnRequest, OnResponse}; pub use tracing::{debug, error, info, trace, warn}; pub fn setup(log_config: &LogConfig, cra...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/env/logger.rs | crate: src use tracing::level_filters::LevelFilter; use tracing_subscriber::{fmt, EnvFilter, Layer}; fn get_envfilter<'a>( filtering_directive: Option<&String>, default_log_level: impl Into<LevelFilter> + Copy, filter_log_level: impl...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/env/logger.rs | crate: src use tracing_appender::non_blocking::WorkerGuard; use tracing_subscriber::layer::SubscriberExt; use tracing_subscriber::util::SubscriberInitExt; use tracing_subscriber::{fmt, EnvFilter, Layer}; pub(super) fn setup_logging_pipeline( ...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/env/logger.rs | crate: src use tracing::level_filters::LevelFilter; fn on_response( self, response: &hyper::Response<B>, latency: std::time::Duration, _: &tracing::Span, ) { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/env/logger.rs | crate: src use tracing::level_filters::LevelFilter; fn on_response( self, response: &hyper::Response<B>, latency: std::time::Duration, _: &tracing::Span, ) { { LogLevel::Debug => { tracing::eve...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/env/logger.rs | crate: src use tracing::level_filters::LevelFilter; fn on_request(&mut self, _: &hyper::Request<B>, _: &tracing::Span) { { LogLevel::Debug => { tracing::event!(tracing::Level::DEBUG, "Started processing request"); }<|...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/env/logger.rs | crate: src pub fn with_level(level: LogLevel) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/env/logger.rs | crate: src use tracing::level_filters::LevelFilter; fn on_request(&mut self, _: &hyper::Request<B>, _: &tracing::Span) { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/env/logger.rs | crate: src fn from(value: LogLevel) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/errors/db.rs | crate: src fn switch(self) -> super::CustomResult<T, super::DatabaseError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
// file: hyperswitch-encryption-service/src/errors/db.rs | crate: src fn switch(self) -> super::CustomResult<T, super::DatabaseError> { self.change_context(DatabaseError::InvalidValue) }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/errors/db.rs | crate: src use crate::env::observability as logger; use error_stack::{report, ResultExt}; fn switch(self) -> super::CustomResult<T, DatabaseError> { { charybdis::errors::CharybdisError::NotFoundError(err) => { (DatabaseError::...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/errors/db.rs | crate: src use diesel::result::{DatabaseErrorKind, Error as diesel_error}; use error_stack::{report, ResultExt}; fn switch(self) -> super::CustomResult<T, DatabaseError> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/errors/app.rs | crate: src use axum::response::{IntoResponse, Response}; use hyper::StatusCode; fn into_response(self) -> Response { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/errors/app.rs | crate: src use axum::response::{IntoResponse, Response}; use hyper::StatusCode; fn into_response(self) -> Response { { err @ ApplicationErrorResponse::InternalServerError(_) => ( StatusCode::INTERNAL_SERVER_ERROR, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/errors/app.rs | crate: src use super::SwitchError; pub type ApiResponseResult<T> = Result<T, ApiErrorContainer>; fn switch(self) -> super::CustomResult<T, ApplicationErrorResponse> { { super::DatabaseError::NotFound => ApplicationErrorResponse::NotFound("Databa...
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/errors/app.rs | crate: src pub type ApiResponseResult<T> = Result<T, ApiErrorContainer>; fn to_container_error(self) -> Result<T, ApiErrorContainer> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/errors/app.rs | crate: src use super::SwitchError; pub type ApiResponseResult<T> = Result<T, ApiErrorContainer>; fn switch(self) -> super::CustomResult<T, ApplicationErrorResponse> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/errors/app.rs | crate: src use super::SwitchError; pub type ApiResponseResult<T> = Result<T, ApiErrorContainer>; fn switch(self) -> super::CustomResult<T, ParsingError> { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/services/aws/config.rs | crate: src use aws_config::{meta::region::RegionProviderChain, BehaviorVersion}; use aws_sdk_kms::{config::Region, Client}; pub async fn new(config: &AwsKmsConfig) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/services/aws/config.rs | crate: src pub fn key_id(&self) -> &str { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch-encryption-service/src/services/aws/config.rs | crate: src use aws_sdk_kms::{config::Region, Client}; pub fn inner_client(&self) -> &Client { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch-encryption-service/src/services/aws/config.rs | crate: src use aws_config::{meta::region::RegionProviderChain, BehaviorVersion}; use aws_sdk_kms::{config::Region, Client}; pub async fn new(config: &AwsKmsConfig) -> Self { let region_provider = RegionProviderChain::first_try(Region::new(conf...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lookup.rs | crate: storage_impl use common_utils::errors::CustomResult; use diesel_models::{ enums as storage_enums, kv, reverse_lookup::{ ReverseLookup as DieselReverseLookup, ReverseLookupNew as DieselReverseLookupNew, }, }; use crate::{ ...
ast_fragments
// file: hyperswitch/crates/storage_impl/src/lookup.rs | crate: storage_impl use common_utils::errors::CustomResult; use diesel_models::{ enums as storage_enums, kv, reverse_lookup::{ ReverseLookup as DieselReverseLookup, ReverseLookupNew as DieselReverseLookupNew, }, }; use redis_interface::SetnxRe...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lookup.rs | crate: storage_impl use common_utils::errors::CustomResult; use diesel_models::{ enums as storage_enums, kv, reverse_lookup::{ ReverseLookup as DieselReverseLookup, ReverseLookupNew as DieselReverseLookupNew, }, }; use redis_int...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lookup.rs | crate: storage_impl use common_utils::errors::CustomResult; use diesel_models::{ enums as storage_enums, kv, reverse_lookup::{ ReverseLookup as DieselReverseLookup, ReverseLookupNew as DieselReverseLookupNew, }, }; use crate::{ ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lookup.rs | crate: storage_impl use common_utils::errors::CustomResult; use diesel_models::{ enums as storage_enums, kv, reverse_lookup::{ ReverseLookup as DieselReverseLookup, ReverseLookupNew as DieselReverseLookupNew, }, }; use crate::{ ...
ast_fragments
// file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl use std::{fmt::Debug, sync::Arc}; use diesel_models as store; use error_stack::ResultExt; use hyperswitch_domain_models::{ behaviour::{Conversion, ReverseConversion}, merchant_key_store::MerchantKeyStore, }; use common_utils::{errors::Cus...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl use std::{fmt::Debug, sync::Arc}; use diesel_models as store; use error_stack::ResultExt; use hyperswitch_domain_models::{ behaviour::{Conversion, ReverseConversion}, merchant_key_store::MerchantKeyStore, }; use common_util...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl use std::{fmt::Debug, sync::Arc}; use error_stack::ResultExt; use masking::StrongSecret; use redis::{kv_store::RedisConnInterface, pub_sub::PubSubInterface, RedisStore}; pub use mock_db::MockDb; use redis_interface::{errors::RedisE...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl use std::{fmt::Debug, sync::Arc}; use error_stack::ResultExt; use common_utils::{errors::CustomResult, types::keymanager::KeyManagerState}; use redis_interface::{errors::RedisError, RedisConnectionPool, SaddReply}; async fn check_f...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl use diesel_models as store; use error_stack::ResultExt; use common_utils::{errors::CustomResult, types::keymanager::KeyManagerState}; pub use mock_db::MockDb; use redis_interface::{errors::RedisError, RedisConnectionPool, SaddReply...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl fn unique_constraints(&self) -> Vec<String> { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl fn table_name(&self) -> &str { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl fn unique_constraints(&self) -> Vec<String> { vec![format!( "refund_{}_{}", self.merchant_id.get_string_repr(), self.refund_id )] }
ast_fragments
// file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl fn unique_constraints(&self) -> Vec<String> { vec![format!( "pa_{}_{}_{}", self.merchant_id.get_string_repr(), self.payment_id.get_string_repr(), self.attempt_id )] }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl use std::{fmt::Debug, sync::Arc}; use error_stack::ResultExt; use common_utils::{errors::CustomResult, types::keymanager::KeyManagerState}; use redis_interface::{errors::RedisError, RedisConnectionPool, SaddReply}; async fn check_f...
ast_fragments
// file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl use diesel_models as store; use error_stack::ResultExt; use common_utils::{errors::CustomResult, types::keymanager::KeyManagerState}; pub use mock_db::MockDb; use redis_interface::{errors::RedisError, RedisConnectionPool, SaddReply}; pub use crat...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl use std::{fmt::Debug, sync::Arc}; use error_stack::ResultExt; use masking::StrongSecret; use redis::{kv_store::RedisConnInterface, pub_sub::PubSubInterface, RedisStore}; pub use mock_db::MockDb; use redis_interface::{errors::RedisE...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/storage_impl/src/lib.rs | crate: storage_impl use masking::StrongSecret; pub use mock_db::MockDb; pub use crate::database::store::Store; pub use crate::{database::store::DatabaseStore, errors::StorageError}; pub fn master_key(&self) -> &StrongSecret<Vec<u8>> { {<|fim_suffix|> ...
ast_fragments