toJson method

  1. @override
Object toJson()
override

Implementation

@override
Object toJson() {
  return {
    if (name.isNotDefault) 'name': name,
    'displayName': displayName,
    'datasets': datasets,
    if (annotationLabels.isNotDefault) 'annotationLabels': annotationLabels,
    'labelerCount': labelerCount,
    'instructionUri': instructionUri,
    'inputsSchemaUri': inputsSchemaUri,
    if (inputs != null) 'inputs': inputs!.toJson(),
    if (state.isNotDefault) 'state': state.toJson(),
    if (labelingProgress.isNotDefault) 'labelingProgress': labelingProgress,
    if (currentSpend != null) 'currentSpend': currentSpend!.toJson(),
    if (createTime != null) 'createTime': createTime!.toJson(),
    if (updateTime != null) 'updateTime': updateTime!.toJson(),
    if (error != null) 'error': error!.toJson(),
    if (labels.isNotDefault) 'labels': labels,
    if (specialistPools.isNotDefault) 'specialistPools': specialistPools,
    if (encryptionSpec != null) 'encryptionSpec': encryptionSpec!.toJson(),
    if (activeLearningConfig != null)
      'activeLearningConfig': activeLearningConfig!.toJson(),
  };
}