module Web.Stripe.Types.Util
(
getTransactionId
, getCustomerId
, getCardId
, getRecipientCardId
, getRecipientId
, getAccountId
, getChargeId
, getInvoiceId
, getInvoiceItemId
) where
import Data.Text (Text)
import Web.Stripe.Types
getTransactionId :: TransactionId -> Text
getTransactionId (TransactionId x) = x
getTransactionId (ExpandedTransaction BalanceTransaction { balanceTransactionId = TransactionId x }) = x
getTransactionId _ = ""
getCustomerId :: CustomerId -> Text
getCustomerId (CustomerId x) = x
getCustomerId (ExpandedCustomer Customer { customerId = CustomerId x }) = x
getCustomerId _ = ""
getCardId :: CardId -> Text
getCardId (CardId x) = x
getCardId (ExpandedCard Card { cardId = CardId x }) = x
getCardId _ = ""
getRecipientCardId :: RecipientCardId -> Text
getRecipientCardId (RecipientCardId x) = x
getRecipientCardId (ExpandedRecipientCard RecipientCard { recipientCardId = RecipientCardId x }) = x
getRecipientCardId _ = ""
getRecipientId :: RecipientId -> Text
getRecipientId (RecipientId x) = x
getRecipientId (ExpandedRecipient Recipient { recipientId = RecipientId x }) = x
getRecipientId _ = ""
getAccountId :: AccountId -> Text
getAccountId (AccountId x) = x
getAccountId (ExpandedAccount Account { accountId = AccountId x }) = x
getAccountId _ = ""
getChargeId :: ChargeId -> Text
getChargeId (ChargeId x) = x
getChargeId (ExpandedCharge Charge { chargeId = ChargeId x }) = x
getChargeId _ = ""
getInvoiceId :: InvoiceId -> Text
getInvoiceId (InvoiceId x) = x
getInvoiceId (ExpandedInvoice Invoice { invoiceId = Nothing }) = ""
getInvoiceId (ExpandedInvoice Invoice { invoiceId = Just (InvoiceId x) }) = x
getInvoiceId _ = ""
getInvoiceItemId :: InvoiceItemId -> Text
getInvoiceItemId (InvoiceItemId x) = x
getInvoiceItemId (ExpandedInvoiceItem InvoiceItem { invoiceItemId = InvoiceItemId x }) = x
getInvoiceItemId _ = ""