chore: resolve v2 warnings in api_models (#7353)

Co-authored-by: Aishwariyaa Anand <aishwariyaa.anand@Aishwariyaa-Anand-C3PGW02T6Y.local>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Aishwariyaa Anand
2025-04-30 15:57:07 +05:30
committed by GitHub
parent 0250f16958
commit 8bca14e960
5 changed files with 47 additions and 49 deletions

View File

@ -5,34 +5,28 @@ use super::{
PaymentStartRedirectionRequest, PaymentsCreateIntentRequest, PaymentsGetIntentRequest,
PaymentsIntentResponse, PaymentsRequest,
};
#[cfg(all(
any(feature = "v2", feature = "v1"),
not(feature = "payment_methods_v2")
))]
use crate::payment_methods::CustomerPaymentMethodsListResponse;
#[cfg(feature = "v1")]
use crate::payments::{PaymentListFilterConstraints, PaymentListResponseV2};
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
use crate::{events, payment_methods::CustomerPaymentMethodsListResponse};
use crate::payments::{
ExtendedCardInfoResponse, PaymentIdType, PaymentListFilterConstraints, PaymentListResponseV2,
PaymentsApproveRequest, PaymentsCancelRequest, PaymentsCaptureRequest,
PaymentsCompleteAuthorizeRequest, PaymentsDynamicTaxCalculationRequest,
PaymentsDynamicTaxCalculationResponse, PaymentsExternalAuthenticationRequest,
PaymentsExternalAuthenticationResponse, PaymentsIncrementalAuthorizationRequest,
PaymentsManualUpdateRequest, PaymentsManualUpdateResponse, PaymentsPostSessionTokensRequest,
PaymentsPostSessionTokensResponse, PaymentsRejectRequest, PaymentsRetrieveRequest,
PaymentsStartRequest, PaymentsUpdateMetadataRequest, PaymentsUpdateMetadataResponse,
};
use crate::{
payment_methods::{
self, ListCountriesCurrenciesRequest, ListCountriesCurrenciesResponse,
PaymentMethodCollectLinkRenderRequest, PaymentMethodCollectLinkRequest,
PaymentMethodCollectLinkResponse, PaymentMethodDeleteResponse, PaymentMethodListRequest,
PaymentMethodListResponse, PaymentMethodMigrateResponse, PaymentMethodResponse,
PaymentMethodUpdate,
PaymentMethodCollectLinkResponse, PaymentMethodListRequest, PaymentMethodListResponse,
PaymentMethodMigrateResponse, PaymentMethodResponse, PaymentMethodUpdate,
},
payments::{
self, ExtendedCardInfoResponse, PaymentIdType, PaymentListConstraints, PaymentListFilters,
PaymentListFiltersV2, PaymentListResponse, PaymentsAggregateResponse,
PaymentsApproveRequest, PaymentsCancelRequest, PaymentsCaptureRequest,
PaymentsCompleteAuthorizeRequest, PaymentsDynamicTaxCalculationRequest,
PaymentsDynamicTaxCalculationResponse, PaymentsExternalAuthenticationRequest,
PaymentsExternalAuthenticationResponse, PaymentsIncrementalAuthorizationRequest,
PaymentsManualUpdateRequest, PaymentsManualUpdateResponse,
PaymentsPostSessionTokensRequest, PaymentsPostSessionTokensResponse, PaymentsRejectRequest,
PaymentsRetrieveRequest, PaymentsSessionResponse, PaymentsStartRequest,
PaymentsUpdateMetadataRequest, PaymentsUpdateMetadataResponse, RedirectionResponse,
self, PaymentListConstraints, PaymentListFilters, PaymentListFiltersV2,
PaymentListResponse, PaymentsAggregateResponse, PaymentsSessionResponse,
RedirectionResponse,
},
};
@ -272,7 +266,7 @@ impl ApiEventMetric for payment_methods::DefaultPaymentMethod {
}
#[cfg(feature = "v2")]
impl ApiEventMetric for PaymentMethodDeleteResponse {
impl ApiEventMetric for payment_methods::PaymentMethodDeleteResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::PaymentMethod {
payment_method_id: self.id.clone(),
@ -283,7 +277,7 @@ impl ApiEventMetric for PaymentMethodDeleteResponse {
}
#[cfg(feature = "v1")]
impl ApiEventMetric for PaymentMethodDeleteResponse {
impl ApiEventMetric for payment_methods::PaymentMethodDeleteResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::PaymentMethod {
payment_method_id: self.payment_method_id.clone(),
@ -293,7 +287,7 @@ impl ApiEventMetric for PaymentMethodDeleteResponse {
}
}
impl ApiEventMetric for CustomerPaymentMethodsListResponse {}
impl ApiEventMetric for payment_methods::CustomerPaymentMethodsListResponse {}
impl ApiEventMetric for PaymentMethodListRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {

View File

@ -1,13 +1,12 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};
#[cfg(feature = "v1")]
use crate::refunds::RefundRequest;
#[cfg(feature = "v2")]
use crate::refunds::RefundsCreateRequest;
use crate::refunds::{
RefundAggregateResponse, RefundListFilters, RefundListMetaData, RefundListRequest,
RefundListResponse, RefundManualUpdateRequest, RefundResponse, RefundUpdateRequest,
RefundsRetrieveRequest,
self, RefundAggregateResponse, RefundListFilters, RefundListMetaData, RefundListRequest,
RefundListResponse,
};
#[cfg(feature = "v1")]
use crate::refunds::{
RefundManualUpdateRequest, RefundRequest, RefundUpdateRequest, RefundsRetrieveRequest,
};
#[cfg(feature = "v1")]
@ -24,14 +23,14 @@ impl ApiEventMetric for RefundRequest {
}
#[cfg(feature = "v2")]
impl ApiEventMetric for RefundsCreateRequest {
impl ApiEventMetric for refunds::RefundsCreateRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
None
}
}
#[cfg(feature = "v1")]
impl ApiEventMetric for RefundResponse {
impl ApiEventMetric for refunds::RefundResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Refund {
payment_id: Some(self.payment_id.clone()),
@ -41,7 +40,7 @@ impl ApiEventMetric for RefundResponse {
}
#[cfg(feature = "v2")]
impl ApiEventMetric for RefundResponse {
impl ApiEventMetric for refunds::RefundResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Refund {
payment_id: self.payment_id.clone(),