encode<V> static method

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

Implementation

static V encode<V>(
  ClimateSupplier instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeString(
    'id',
    instance.id,
  );
  container.encodeString(
    'info_url',
    instance.infoUrl,
  );
  container.encodeBool(
    'livemode',
    instance.livemode,
  );
  container.encodeList(
    'locations',
    (container) =>
        instance.locations.forEach((el) => ClimateRemovalsLocation.encode(
              el,
              container.nestedSingleValueContainer().encoder,
            )),
  );
  container.encodeString(
    'name',
    instance.name,
  );
  container.encodeString(
    'object',
    'climate.supplier',
  );
  container.encodeString(
    'removal_pathway',
    instance.removalPathway,
  );
  return container.value;
}