SaveConsumerValuableRequest:
  description: |
    A representation of the details required to securely save a payment instrument in the consumer's wallet.
  type: object
  required:
    - payment_details
  properties:
    consumer_id:
      description: |
        The merchant's unique id for the consumer who is saving the valuable.
        This can for instance be a GUID or the consumer's email.
      type: string
      minLength: 1
      maxLength: 40
      example: f41182aa-567d-45d4-b6b8-2f5b4f01e2ae
    name:
      description: |
        The consumer assigned name for the valuable that will be saved in the wallet.
      type: string
      minLength: 2
      maxLength: 100
      example: SAS Eurobonus
    contact:
      description: The consumer's contact details such as email address, mobile phone etc.
      $ref: '../../common/contact-details/contact-details_v1.yaml#/ContactDetails'
    national_identification_number:
      $ref: '../../common/national-identification-number/national-identification-number_v1.yaml#/NationalIdentificationNumber'
    payment_details:
      oneOf:
        - $ref: '../../common/payment-details/payment-card_v1.yaml#/PaymentCard'
        - $ref: '../../common/payment-details/google-pay_v1.yaml#/GooglePayPayment'
      discriminator:
        propertyName: payment_method_id
        mapping:
          100: '../../model/common/payment-details/payment-card_v1.yaml#/PaymentCard'  # PAYMENT_CARD
          101: '../../model/common/payment-details/payment-card_v1.yaml#/PaymentCard'  # AMEX
          102: '../../model/common/payment-details/payment-card_v1.yaml#/PaymentCard'  # DANKORT
          103: '../../model/common/payment-details/payment-card_v1.yaml#/PaymentCard'  # VISA_DANKORT
          104: '../../model/common/payment-details/payment-card_v1.yaml#/PaymentCard'  # DINERS_CLUB
          105: '../../model/common/payment-details/payment-card_v1.yaml#/PaymentCard'  # DISCOVER
          106: '../../model/common/payment-details/payment-card_v1.yaml#/PaymentCard'  # JCB
          107: '../../model/common/payment-details/payment-card_v1.yaml#/PaymentCard'  # MAESTRO
          108: '../../model/common/payment-details/payment-card_v1.yaml#/PaymentCard'  # MASTERCARD
          109: '../../model/common/payment-details/payment-card_v1.yaml#/PaymentCard'  # VISA
          110: '../../model/common/payment-details/payment-card_v1.yaml#/PaymentCard'  # VISA_ELECTRON
          203: '../../model/common/payment-details/google-pay_v1.yaml#/GooglePayPayment'

SaveConsumerValuableResponse:
  description: |
    A representation of the details for successfully saving a payment instrument in the consumer's wallet.
  type: object
  required:
    - valuable_id
  properties:
    valuable_id:
      description: |
        The unique ID for the valuable in the consumer's wallet.  
      $ref: '../../common/record-entity-id/record-entity-id_v1.yaml#/RecordEntityId'