encode<V> static method

V encode<V>(
  1. RegistrationUs instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  RegistrationUs instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.localAmusementTax != null) {
    TaxProductRegistrationsResourceCountryOptionsUsLocalLeaseTax.encode(
      instance.localAmusementTax!,
      container.nestedSingleValueContainer('local_amusement_tax').encoder,
    );
  }
  if (instance.localLeaseTax != null) {
    TaxProductRegistrationsResourceCountryOptionsUsLocalLeaseTax.encode(
      instance.localLeaseTax!,
      container.nestedSingleValueContainer('local_lease_tax').encoder,
    );
  }
  container.encodeString(
    'state',
    instance.state,
  );
  TaxProductRegistrationsResourceCountryOptionsUnitedStatesType.encode(
    instance.type,
    container.nestedSingleValueContainer('type').encoder,
  );
  return container.value;
}