feat: add support for sdk session call in v2 (#6502)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Hrithikesh
2024-11-28 15:31:57 +05:30
committed by GitHub
parent 93459fde5f
commit 707f48ceda
18 changed files with 1035 additions and 67 deletions

View File

@ -369,6 +369,41 @@ mod id_type {
}
}
/// Create new generic list wrapper
#[macro_export]
macro_rules! create_list_wrapper {
(
$wrapper_name:ident,
$type_name: ty,
impl_functions: {
$($function_def: tt)*
}
) => {
pub struct $wrapper_name(Vec<$type_name>);
impl $wrapper_name {
pub fn new(list: Vec<$type_name>) -> Self {
Self(list)
}
pub fn iter(&self) -> std::slice::Iter<'_, $type_name> {
self.0.iter()
}
$($function_def)*
}
impl Iterator for $wrapper_name {
type Item = $type_name;
fn next(&mut self) -> Option<Self::Item> {
self.0.pop()
}
}
impl FromIterator<$type_name> for $wrapper_name {
fn from_iter<T: IntoIterator<Item = $type_name>>(iter: T) -> Self {
Self(iter.into_iter().collect())
}
}
};
}
/// Get the type name for a type
#[macro_export]
macro_rules! type_name {

View File

@ -845,7 +845,7 @@ mod client_secret_type {
Ok(row)
}
}
crate::impl_serializable_secret_id_type!(ClientSecret);
#[cfg(test)]
mod client_secret_tests {
#![allow(clippy::expect_used)]