mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 12:15:40 +08:00
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:
@ -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 {
|
||||
|
||||
@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user