encode<V> static method

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

Implementation

static V encode<V>(
  TaxRegistration instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeDateTime(
    'active_from',
    instance.activeFrom,
  );
  container.encodeString(
    'country',
    instance.country,
  );
  TaxProductRegistrationsResourceCountryOptions.encode(
    instance.countryOptions,
    container.nestedSingleValueContainer('country_options').encoder,
  );
  container.encodeDateTime(
    'created',
    instance.created,
  );
  if (instance.expiresAt != null) {
    container.encodeDateTime(
      'expires_at',
      instance.expiresAt!,
    );
  }
  container.encodeString(
    'id',
    instance.id,
  );
  container.encodeBool(
    'livemode',
    instance.livemode,
  );
  container.encodeString(
    'object',
    'tax.registration',
  );
  container.encodeString(
    'status',
    instance.status,
  );
  return container.value;
}