encode<V> static method

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

Implementation

static V encode<V>(
  RadarValueList instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeString(
    'alias',
    instance.alias,
  );
  container.encodeDateTime(
    'created',
    instance.created,
  );
  container.encodeString(
    'created_by',
    instance.createdBy,
  );
  container.encodeString(
    'id',
    instance.id,
  );
  container.encodeString(
    'item_type',
    instance.itemType,
  );
  RadarValueListListItems.encode(
    instance.listItems,
    container.nestedSingleValueContainer('list_items').encoder,
  );
  container.encodeBool(
    'livemode',
    instance.livemode,
  );
  container.encodeMap(
    'metadata',
    (container) => instance.metadata.forEach((
      key,
      value,
    ) =>
        container.encodeString(
          key,
          value,
        )),
  );
  container.encodeString(
    'name',
    instance.name,
  );
  container.encodeString(
    'object',
    'radar.value_list',
  );
  return container.value;
}