getFieldDeserializers method

  1. @override
Map<String, void Function(ParseNode)> getFieldDeserializers()
override

The deserialization information for the current model

Implementation

@override
Map<String, void Function(ParseNode)> getFieldDeserializers() {
  var deserializerMap = <String, void Function(ParseNode)>{};
  deserializerMap['active'] = (node) => active = node.getBoolValue();
  deserializerMap['after_completion'] = (node) => afterCompletion =
      node.getObjectValue<PaymentLinksResourceAfterCompletion>(
          PaymentLinksResourceAfterCompletion.createFromDiscriminatorValue);
  deserializerMap['allow_promotion_codes'] =
      (node) => allowPromotionCodes = node.getBoolValue();
  deserializerMap['application'] = (node) => application =
      node.getObjectValue<PaymentLinkApplication>(
          PaymentLinkApplication.createFromDiscriminatorValue);
  deserializerMap['application_fee_amount'] =
      (node) => applicationFeeAmount = node.getIntValue();
  deserializerMap['application_fee_percent'] =
      (node) => applicationFeePercent = node.getDoubleValue();
  deserializerMap['automatic_tax'] = (node) => automaticTax =
      node.getObjectValue<PaymentLinksResourceAutomaticTax>(
          PaymentLinksResourceAutomaticTax.createFromDiscriminatorValue);
  deserializerMap['billing_address_collection'] = (node) =>
      billingAddressCollection =
          node.getEnumValue<PaymentLinkBillingAddressCollection>(
              (stringValue) => PaymentLinkBillingAddressCollection.values
                  .where((enumVal) => enumVal.value == stringValue)
                  .firstOrNull);
  deserializerMap['consent_collection'] = (node) => consentCollection =
      node.getObjectValue<PaymentLinksResourceConsentCollection>(
          PaymentLinksResourceConsentCollection.createFromDiscriminatorValue);
  deserializerMap['currency'] = (node) => currency = node.getStringValue();
  deserializerMap['customer_creation'] = (node) => customerCreation =
      node.getEnumValue<PaymentLinkCustomerCreation>((stringValue) =>
          PaymentLinkCustomerCreation.values
              .where((enumVal) => enumVal.value == stringValue)
              .firstOrNull);
  deserializerMap['custom_fields'] = (node) => customFields =
      node.getCollectionOfObjectValues<PaymentLinksResourceCustomFields>(
          PaymentLinksResourceCustomFields.createFromDiscriminatorValue);
  deserializerMap['custom_text'] = (node) => customText =
      node.getObjectValue<PaymentLinksResourceCustomText>(
          PaymentLinksResourceCustomText.createFromDiscriminatorValue);
  deserializerMap['id'] = (node) => id = node.getStringValue();
  deserializerMap['inactive_message'] =
      (node) => inactiveMessage = node.getStringValue();
  deserializerMap['invoice_creation'] = (node) => invoiceCreation =
      node.getObjectValue<PaymentLinksResourceInvoiceCreation>(
          PaymentLinksResourceInvoiceCreation.createFromDiscriminatorValue);
  deserializerMap['line_items'] = (node) => lineItems =
      node.getObjectValue<PaymentLinkLineItems>(
          PaymentLinkLineItems.createFromDiscriminatorValue);
  deserializerMap['livemode'] = (node) => livemode = node.getBoolValue();
  deserializerMap['metadata'] = (node) => metadata =
      node.getObjectValue<PaymentLinkMetadata>(
          PaymentLinkMetadata.createFromDiscriminatorValue);
  deserializerMap['name_collection'] = (node) => nameCollection =
      node.getObjectValue<PaymentLinksResourceNameCollection>(
          PaymentLinksResourceNameCollection.createFromDiscriminatorValue);
  deserializerMap['object'] = (node) => object =
      node.getEnumValue<PaymentLinkObject>((stringValue) => PaymentLinkObject
          .values
          .where((enumVal) => enumVal.value == stringValue)
          .firstOrNull);
  deserializerMap['on_behalf_of'] = (node) => onBehalfOf =
      node.getObjectValue<PaymentLinkOnBehalfOf>(
          PaymentLinkOnBehalfOf.createFromDiscriminatorValue);
  deserializerMap['optional_items'] = (node) => optionalItems =
      node.getCollectionOfObjectValues<PaymentLinksResourceOptionalItem>(
          PaymentLinksResourceOptionalItem.createFromDiscriminatorValue);
  deserializerMap['payment_intent_data'] = (node) => paymentIntentData =
      node.getObjectValue<PaymentLinksResourcePaymentIntentData>(
          PaymentLinksResourcePaymentIntentData.createFromDiscriminatorValue);
  deserializerMap['payment_method_collection'] = (node) =>
      paymentMethodCollection =
          node.getEnumValue<PaymentLinkPaymentMethodCollection>(
              (stringValue) => PaymentLinkPaymentMethodCollection.values
                  .where((enumVal) => enumVal.value == stringValue)
                  .firstOrNull);
  deserializerMap['payment_method_types'] = (node) => paymentMethodTypes =
      node.getCollectionOfEnumValues<PaymentLinkPaymentMethodTypes>(
          (stringValue) => PaymentLinkPaymentMethodTypes.values
              .where((enumVal) => enumVal.value == stringValue)
              .firstOrNull);
  deserializerMap['phone_number_collection'] = (node) =>
      phoneNumberCollection =
          node.getObjectValue<PaymentLinksResourcePhoneNumberCollection>(
              PaymentLinksResourcePhoneNumberCollection
                  .createFromDiscriminatorValue);
  deserializerMap['restrictions'] = (node) => restrictions =
      node.getObjectValue<PaymentLinksResourceRestrictions>(
          PaymentLinksResourceRestrictions.createFromDiscriminatorValue);
  deserializerMap['shipping_address_collection'] = (node) =>
      shippingAddressCollection =
          node.getObjectValue<PaymentLinksResourceShippingAddressCollection>(
              PaymentLinksResourceShippingAddressCollection
                  .createFromDiscriminatorValue);
  deserializerMap['shipping_options'] = (node) => shippingOptions =
      node.getCollectionOfObjectValues<PaymentLinksResourceShippingOption>(
          PaymentLinksResourceShippingOption.createFromDiscriminatorValue);
  deserializerMap['submit_type'] = (node) => submitType =
      node.getEnumValue<PaymentLinkSubmitType>((stringValue) =>
          PaymentLinkSubmitType.values
              .where((enumVal) => enumVal.value == stringValue)
              .firstOrNull);
  deserializerMap['subscription_data'] = (node) => subscriptionData =
      node.getObjectValue<PaymentLinksResourceSubscriptionData>(
          PaymentLinksResourceSubscriptionData.createFromDiscriminatorValue);
  deserializerMap['tax_id_collection'] = (node) => taxIdCollection =
      node.getObjectValue<PaymentLinksResourceTaxIdCollection>(
          PaymentLinksResourceTaxIdCollection.createFromDiscriminatorValue);
  deserializerMap['transfer_data'] = (node) => transferData =
      node.getObjectValue<PaymentLinksResourceTransferData>(
          PaymentLinksResourceTransferData.createFromDiscriminatorValue);
  deserializerMap['url'] = (node) => url = node.getStringValue();
  return deserializerMap;
}