encode<V> static method

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

Implementation

static V encode<V>(
  ScheduledQueryRun instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeDateTime(
    'created',
    instance.created,
  );
  container.encodeDateTime(
    'data_load_time',
    instance.dataLoadTime,
  );
  if (instance.error != null) {
    SigmaScheduledQueryRunError.encode(
      instance.error!,
      container.nestedSingleValueContainer('error').encoder,
    );
  }
  if (instance.file != null) {
    File.encode(
      instance.file!,
      container.nestedSingleValueContainer('file').encoder,
    );
  }
  container.encodeString(
    'id',
    instance.id,
  );
  container.encodeBool(
    'livemode',
    instance.livemode,
  );
  container.encodeString(
    'object',
    'scheduled_query_run',
  );
  container.encodeDateTime(
    'result_available_until',
    instance.resultAvailableUntil,
  );
  container.encodeString(
    'sql',
    instance.sql,
  );
  container.encodeString(
    'status',
    instance.status,
  );
  container.encodeString(
    'title',
    instance.title,
  );
  return container.value;
}