mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +08:00
Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Anurag Thakur <anurag.thakur@juspay.in> Co-authored-by: Pa1NarK <69745008+pixincreate@users.noreply.github.com> Co-authored-by: Shankar Singh C <83439957+ShankarSinghC@users.noreply.github.com> Co-authored-by: Sai Harsha Vardhan <56996463+sai-harsha-vardhan@users.noreply.github.com> Co-authored-by: hrithikesh026 <hrithikesh.vm@juspay.in> Co-authored-by: Debarati Ghatak <88573135+cookieg13@users.noreply.github.com> Co-authored-by: awasthi21 <107559116+awasthi21@users.noreply.github.com> Co-authored-by: Gnanasundari24 <118818938+Gnanasundari24@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Arindam Sahoo <88739246+arindam-sahoo@users.noreply.github.com> Co-authored-by: Arindam Sahoo <arindam.sahoo@Arindam-Sahoo-F565040VFJ.local> Co-authored-by: Sakil Mostak <73734619+Sakilmostak@users.noreply.github.com> Co-authored-by: AkshayaFoiger <131388445+AkshayaFoiger@users.noreply.github.com> Co-authored-by: Riddhiagrawal001 <50551695+Riddhiagrawal001@users.noreply.github.com> Co-authored-by: Suman Maji <77887221+sumanmaji4@users.noreply.github.com> Co-authored-by: Sandeep Kumar <83278309+tsdk02@users.noreply.github.com> Co-authored-by: Debarshi Gupta <debarshigupta47@gmail.com> Co-authored-by: Debarshi Gupta <debarshi.gupta@Debarshi-Gupta-CM92YWDXFD.local> Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com> Co-authored-by: Swangi Kumari <85639103+swangi-kumari@users.noreply.github.com> Co-authored-by: pranav-arjunan <pranav.arjunan@juspay.in> Co-authored-by: Kashif <kashif.dev@protonmail.com> Co-authored-by: Sagnik Mitra <83326850+ImSagnik007@users.noreply.github.com> Co-authored-by: sweta-kumari-sharma <77436883+Sweta-Kumari-Sharma@users.noreply.github.com>
320 lines
11 KiB
Rust
320 lines
11 KiB
Rust
use router_env::Flow;
|
|
|
|
#[derive(Clone, Debug, strum::Display)]
|
|
#[strum(serialize_all = "snake_case")]
|
|
pub enum ApiIdentifier {
|
|
Payments,
|
|
Refunds,
|
|
Webhooks,
|
|
Organization,
|
|
MerchantAccount,
|
|
MerchantConnector,
|
|
Configs,
|
|
Customers,
|
|
Ephemeral,
|
|
Health,
|
|
Mandates,
|
|
PaymentMethods,
|
|
PaymentMethodAuth,
|
|
Payouts,
|
|
Disputes,
|
|
CardsInfo,
|
|
Files,
|
|
Cache,
|
|
Profile,
|
|
Verification,
|
|
ApiKeys,
|
|
PaymentLink,
|
|
Routing,
|
|
Blocklist,
|
|
Forex,
|
|
RustLockerMigration,
|
|
Gsm,
|
|
Role,
|
|
User,
|
|
UserRole,
|
|
ConnectorOnboarding,
|
|
Recon,
|
|
Poll,
|
|
ApplePayCertificatesMigration,
|
|
Relay,
|
|
Documentation,
|
|
PaymentMethodsSession,
|
|
}
|
|
|
|
impl From<Flow> for ApiIdentifier {
|
|
fn from(flow: Flow) -> Self {
|
|
match flow {
|
|
Flow::MerchantsAccountCreate
|
|
| Flow::MerchantsAccountRetrieve
|
|
| Flow::MerchantsAccountUpdate
|
|
| Flow::MerchantsAccountDelete
|
|
| Flow::MerchantTransferKey
|
|
| Flow::MerchantAccountList
|
|
| Flow::EnablePlatformAccount => Self::MerchantAccount,
|
|
|
|
Flow::OrganizationCreate | Flow::OrganizationRetrieve | Flow::OrganizationUpdate => {
|
|
Self::Organization
|
|
}
|
|
|
|
Flow::RoutingCreateConfig
|
|
| Flow::RoutingLinkConfig
|
|
| Flow::RoutingUnlinkConfig
|
|
| Flow::RoutingRetrieveConfig
|
|
| Flow::RoutingRetrieveActiveConfig
|
|
| Flow::RoutingRetrieveDefaultConfig
|
|
| Flow::RoutingRetrieveDictionary
|
|
| Flow::RoutingUpdateConfig
|
|
| Flow::RoutingUpdateDefaultConfig
|
|
| Flow::RoutingDeleteConfig
|
|
| Flow::DecisionManagerDeleteConfig
|
|
| Flow::DecisionManagerRetrieveConfig
|
|
| Flow::ToggleDynamicRouting
|
|
| Flow::UpdateDynamicRoutingConfigs
|
|
| Flow::DecisionManagerUpsertConfig
|
|
| Flow::VolumeSplitOnRoutingType => Self::Routing,
|
|
|
|
Flow::RetrieveForexFlow => Self::Forex,
|
|
|
|
Flow::AddToBlocklist => Self::Blocklist,
|
|
Flow::DeleteFromBlocklist => Self::Blocklist,
|
|
Flow::ListBlocklist => Self::Blocklist,
|
|
Flow::ToggleBlocklistGuard => Self::Blocklist,
|
|
|
|
Flow::MerchantConnectorsCreate
|
|
| Flow::MerchantConnectorsRetrieve
|
|
| Flow::MerchantConnectorsUpdate
|
|
| Flow::MerchantConnectorsDelete
|
|
| Flow::MerchantConnectorsList => Self::MerchantConnector,
|
|
|
|
Flow::ConfigKeyCreate
|
|
| Flow::ConfigKeyFetch
|
|
| Flow::ConfigKeyUpdate
|
|
| Flow::ConfigKeyDelete
|
|
| Flow::CreateConfigKey => Self::Configs,
|
|
|
|
Flow::CustomersCreate
|
|
| Flow::CustomersRetrieve
|
|
| Flow::CustomersUpdate
|
|
| Flow::CustomersDelete
|
|
| Flow::CustomersGetMandates
|
|
| Flow::CustomersList => Self::Customers,
|
|
|
|
Flow::EphemeralKeyCreate | Flow::EphemeralKeyDelete => Self::Ephemeral,
|
|
|
|
Flow::DeepHealthCheck | Flow::HealthCheck => Self::Health,
|
|
Flow::MandatesRetrieve | Flow::MandatesRevoke | Flow::MandatesList => Self::Mandates,
|
|
|
|
Flow::PaymentMethodsCreate
|
|
| Flow::PaymentMethodsMigrate
|
|
| Flow::PaymentMethodsList
|
|
| Flow::CustomerPaymentMethodsList
|
|
| Flow::PaymentMethodsRetrieve
|
|
| Flow::PaymentMethodsUpdate
|
|
| Flow::PaymentMethodsDelete
|
|
| Flow::PaymentMethodCollectLink
|
|
| Flow::ValidatePaymentMethod
|
|
| Flow::ListCountriesCurrencies
|
|
| Flow::DefaultPaymentMethodsSet
|
|
| Flow::PaymentMethodSave => Self::PaymentMethods,
|
|
|
|
Flow::PmAuthLinkTokenCreate | Flow::PmAuthExchangeToken => Self::PaymentMethodAuth,
|
|
|
|
Flow::PaymentsCreate
|
|
| Flow::PaymentsRetrieve
|
|
| Flow::PaymentsRetrieveForceSync
|
|
| Flow::PaymentsUpdate
|
|
| Flow::PaymentsConfirm
|
|
| Flow::PaymentsCapture
|
|
| Flow::PaymentsCancel
|
|
| Flow::PaymentsApprove
|
|
| Flow::PaymentsReject
|
|
| Flow::PaymentsSessionToken
|
|
| Flow::PaymentsStart
|
|
| Flow::PaymentsList
|
|
| Flow::PaymentsFilters
|
|
| Flow::PaymentsAggregate
|
|
| Flow::PaymentsRedirect
|
|
| Flow::PaymentsIncrementalAuthorization
|
|
| Flow::PaymentsExternalAuthentication
|
|
| Flow::PaymentsAuthorize
|
|
| Flow::GetExtendedCardInfo
|
|
| Flow::PaymentsCompleteAuthorize
|
|
| Flow::PaymentsManualUpdate
|
|
| Flow::SessionUpdateTaxCalculation
|
|
| Flow::PaymentsConfirmIntent
|
|
| Flow::PaymentsCreateIntent
|
|
| Flow::PaymentsGetIntent
|
|
| Flow::PaymentsPostSessionTokens
|
|
| Flow::PaymentsUpdateIntent
|
|
| Flow::PaymentsCreateAndConfirmIntent
|
|
| Flow::PaymentStartRedirection
|
|
| Flow::PaymentsRetrieveUsingMerchantReferenceId => Self::Payments,
|
|
|
|
Flow::PayoutsCreate
|
|
| Flow::PayoutsRetrieve
|
|
| Flow::PayoutsUpdate
|
|
| Flow::PayoutsCancel
|
|
| Flow::PayoutsFulfill
|
|
| Flow::PayoutsList
|
|
| Flow::PayoutsFilter
|
|
| Flow::PayoutsAccounts
|
|
| Flow::PayoutsConfirm
|
|
| Flow::PayoutLinkInitiate => Self::Payouts,
|
|
|
|
Flow::RefundsCreate
|
|
| Flow::RefundsRetrieve
|
|
| Flow::RefundsRetrieveForceSync
|
|
| Flow::RefundsUpdate
|
|
| Flow::RefundsList
|
|
| Flow::RefundsFilters
|
|
| Flow::RefundsAggregate
|
|
| Flow::RefundsManualUpdate => Self::Refunds,
|
|
Flow::Relay | Flow::RelayRetrieve => Self::Relay,
|
|
|
|
Flow::FrmFulfillment
|
|
| Flow::IncomingWebhookReceive
|
|
| Flow::IncomingRelayWebhookReceive
|
|
| Flow::WebhookEventInitialDeliveryAttemptList
|
|
| Flow::WebhookEventDeliveryAttemptList
|
|
| Flow::WebhookEventDeliveryRetry => Self::Webhooks,
|
|
|
|
Flow::ApiKeyCreate
|
|
| Flow::ApiKeyRetrieve
|
|
| Flow::ApiKeyUpdate
|
|
| Flow::ApiKeyRevoke
|
|
| Flow::ApiKeyList => Self::ApiKeys,
|
|
|
|
Flow::DisputesRetrieve
|
|
| Flow::DisputesList
|
|
| Flow::DisputesFilters
|
|
| Flow::DisputesEvidenceSubmit
|
|
| Flow::AttachDisputeEvidence
|
|
| Flow::RetrieveDisputeEvidence
|
|
| Flow::DisputesAggregate
|
|
| Flow::DeleteDisputeEvidence => Self::Disputes,
|
|
|
|
Flow::CardsInfo => Self::CardsInfo,
|
|
|
|
Flow::CreateFile | Flow::DeleteFile | Flow::RetrieveFile => Self::Files,
|
|
|
|
Flow::CacheInvalidate => Self::Cache,
|
|
|
|
Flow::ProfileCreate
|
|
| Flow::ProfileUpdate
|
|
| Flow::ProfileRetrieve
|
|
| Flow::ProfileDelete
|
|
| Flow::ProfileList
|
|
| Flow::ToggleExtendedCardInfo
|
|
| Flow::ToggleConnectorAgnosticMit => Self::Profile,
|
|
|
|
Flow::PaymentLinkRetrieve
|
|
| Flow::PaymentLinkInitiate
|
|
| Flow::PaymentSecureLinkInitiate
|
|
| Flow::PaymentLinkList
|
|
| Flow::PaymentLinkStatus => Self::PaymentLink,
|
|
|
|
Flow::Verification => Self::Verification,
|
|
|
|
Flow::RustLockerMigration => Self::RustLockerMigration,
|
|
Flow::GsmRuleCreate
|
|
| Flow::GsmRuleRetrieve
|
|
| Flow::GsmRuleUpdate
|
|
| Flow::GsmRuleDelete => Self::Gsm,
|
|
|
|
Flow::ApplePayCertificatesMigration => Self::ApplePayCertificatesMigration,
|
|
|
|
Flow::UserConnectAccount
|
|
| Flow::UserSignUp
|
|
| Flow::UserSignIn
|
|
| Flow::Signout
|
|
| Flow::ChangePassword
|
|
| Flow::SetDashboardMetadata
|
|
| Flow::GetMultipleDashboardMetadata
|
|
| Flow::VerifyPaymentConnector
|
|
| Flow::InternalUserSignup
|
|
| Flow::TenantUserCreate
|
|
| Flow::SwitchOrg
|
|
| Flow::SwitchMerchantV2
|
|
| Flow::SwitchProfile
|
|
| Flow::UserOrgMerchantCreate
|
|
| Flow::UserMerchantAccountCreate
|
|
| Flow::GenerateSampleData
|
|
| Flow::DeleteSampleData
|
|
| Flow::GetUserDetails
|
|
| Flow::GetUserRoleDetails
|
|
| Flow::ForgotPassword
|
|
| Flow::ResetPassword
|
|
| Flow::RotatePassword
|
|
| Flow::InviteMultipleUser
|
|
| Flow::ReInviteUser
|
|
| Flow::UserSignUpWithMerchantId
|
|
| Flow::VerifyEmail
|
|
| Flow::AcceptInviteFromEmail
|
|
| Flow::VerifyEmailRequest
|
|
| Flow::UpdateUserAccountDetails
|
|
| Flow::TotpBegin
|
|
| Flow::TotpReset
|
|
| Flow::TotpVerify
|
|
| Flow::TotpUpdate
|
|
| Flow::RecoveryCodeVerify
|
|
| Flow::RecoveryCodesGenerate
|
|
| Flow::TerminateTwoFactorAuth
|
|
| Flow::TwoFactorAuthStatus
|
|
| Flow::CreateUserAuthenticationMethod
|
|
| Flow::UpdateUserAuthenticationMethod
|
|
| Flow::ListUserAuthenticationMethods
|
|
| Flow::UserTransferKey
|
|
| Flow::GetSsoAuthUrl
|
|
| Flow::SignInWithSso
|
|
| Flow::ListOrgForUser
|
|
| Flow::ListMerchantsForUserInOrg
|
|
| Flow::ListProfileForUserInOrgAndMerchant
|
|
| Flow::ListInvitationsForUser
|
|
| Flow::AuthSelect
|
|
| Flow::GetThemeUsingLineage
|
|
| Flow::GetThemeUsingThemeId
|
|
| Flow::UploadFileToThemeStorage
|
|
| Flow::CreateTheme
|
|
| Flow::UpdateTheme
|
|
| Flow::DeleteTheme => Self::User,
|
|
|
|
Flow::ListRolesV2
|
|
| Flow::ListInvitableRolesAtEntityLevel
|
|
| Flow::ListUpdatableRolesAtEntityLevel
|
|
| Flow::GetRole
|
|
| Flow::GetRoleV2
|
|
| Flow::GetRoleFromToken
|
|
| Flow::GetRoleFromTokenV2
|
|
| Flow::UpdateUserRole
|
|
| Flow::GetAuthorizationInfo
|
|
| Flow::GetRolesInfo
|
|
| Flow::GetParentGroupInfo
|
|
| Flow::AcceptInvitationsV2
|
|
| Flow::AcceptInvitationsPreAuth
|
|
| Flow::DeleteUserRole
|
|
| Flow::CreateRole
|
|
| Flow::UpdateRole
|
|
| Flow::UserFromEmail
|
|
| Flow::ListUsersInLineage => Self::UserRole,
|
|
|
|
Flow::GetActionUrl | Flow::SyncOnboardingStatus | Flow::ResetTrackingId => {
|
|
Self::ConnectorOnboarding
|
|
}
|
|
|
|
Flow::ReconMerchantUpdate
|
|
| Flow::ReconTokenRequest
|
|
| Flow::ReconServiceRequest
|
|
| Flow::ReconVerifyToken => Self::Recon,
|
|
|
|
Flow::RetrievePollStatus => Self::Poll,
|
|
|
|
Flow::FeatureMatrix => Self::Documentation,
|
|
|
|
Flow::PaymentMethodSessionCreate
|
|
| Flow::PaymentMethodSessionRetrieve
|
|
| Flow::PaymentMethodSessionUpdateSavedPaymentMethod => Self::PaymentMethodsSession,
|
|
}
|
|
}
|
|
}
|