Repository: juspay/hyperswitch
File: crates/api_models/src/payments/additional_info.rs (Rust)

Code before:
#[derive(
    Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,
)]
#[serde(rename_all = "snake_case")]
#[smithy(namespace = "com.hyperswitch.smithy.types")]
pub enum UpiAdditionalData {
    #[smithy(value_type = "UpiCollectAdditionalData")]
    UpiCollect(Box<UpiCollectAdditionalData>),
    #[schema(value_type = UpiIntentData)]
    #[smithy(value_type = "UpiIntentData")]
    UpiIntent(Box<super::UpiIntentData>),
    #[schema(value_type = UpiQrData)]
    UpiQr(Box<super::UpiQrData>),
}

#[derive(
    Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,
)]
#[smithy(namespace = "com.hyperswitch.smithy.types")]
pub struct UpiCollectAdditionalData {
    /// Masked VPA ID
    #[schema(value_type = Option<String>, example = "ab********@okhdfcbank")]
    #[smithy(value_type = "Option<String>")]
    pub vpa_id: Option<MaskedUpiVpaId>,
    #[smithy(value_type = "Option<UpiSource>")]
    pub upi_source: Option<UpiSource>,
}

#[derive(
    Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,
)]
#[smithy(namespace = "com.hyperswitch.smithy.types")]
pub struct WalletAdditionalDataForCard {
    /// Last 4 digits of the card number
    #[smithy(value_type = "String")]
    pub last4: String,
    /// The information of the payment method
    #[smithy(value_type = "String")]
    pub card_network: String,
    /// The type of payment method
    #[serde(rename = "type")]
    #[smithy(value_type = "Option<String>")]
    pub card_type: Option<String>,
    /// The card's expiry month
    #[schema(value_type = Option<String>, example = "03")]
    pub card_exp_month: Option<Secret<String>>,
    /// The card's expiry year
    #[schema(value_type = Option<String>, example = "25")]
    pub card_exp_year: Option<Secret<String>>,
}


Review comment (suggestion):
```suggestion
    #[smithy(value_type = "Option<UpiSource>")]
    pub upi_source: Option<payments::UpiSource>,
```
do not import and use full path

Code after:
#[derive(
    Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,
)]
#[serde(rename_all = "snake_case")]
#[smithy(namespace = "com.hyperswitch.smithy.types")]
pub enum UpiAdditionalData {
    #[smithy(value_type = "UpiCollectAdditionalData")]
    UpiCollect(Box<UpiCollectAdditionalData>),
    #[schema(value_type = UpiIntentData)]
    #[smithy(value_type = "UpiIntentData")]
    UpiIntent(Box<super::UpiIntentData>),
    #[schema(value_type = UpiQrData)]
    UpiQr(Box<super::UpiQrData>),
}

#[derive(
    Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,
)]
#[smithy(namespace = "com.hyperswitch.smithy.types")]
pub struct UpiCollectAdditionalData {
    /// Masked VPA ID
    #[schema(value_type = Option<String>, example = "ab********@okhdfcbank")]
    #[smithy(value_type = "Option<String>")]
    pub vpa_id: Option<MaskedUpiVpaId>,
    #[schema(value_type = Option<UpiSource>)]
    #[smithy(value_type = "Option<UpiSource>")]
    pub upi_source: Option<payments::UpiSource>,
}

#[derive(
    Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,
)]
#[smithy(namespace = "com.hyperswitch.smithy.types")]
pub struct WalletAdditionalDataForCard {
    /// Last 4 digits of the card number
    #[smithy(value_type = "String")]
    pub last4: String,
    /// The information of the payment method
    #[smithy(value_type = "String")]
    pub card_network: String,
    /// The type of payment method
    #[serde(rename = "type")]
    #[smithy(value_type = "Option<String>")]
    pub card_type: Option<String>,
    /// The card's expiry month
    #[schema(value_type = Option<String>, example = "03")]
    pub card_exp_month: Option<Secret<String>>,
    /// The card's expiry year
    #[schema(value_type = Option<String>, example = "25")]
    pub card_exp_year: Option<Secret<String>>,
}