SearchDataItemsRequest.fromJson constructor

SearchDataItemsRequest.fromJson(
  1. Object? j
)

Implementation

factory SearchDataItemsRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return SearchDataItemsRequest(
    orderByDataItem: switch (json['orderByDataItem']) {
      null => null,
      Object $1 => decodeString($1),
    },
    orderByAnnotation: switch (json['orderByAnnotation']) {
      null => null,
      Object $1 => SearchDataItemsRequest_OrderByAnnotation.fromJson($1),
    },
    dataset: switch (json['dataset']) {
      null => '',
      Object $1 => decodeString($1),
    },
    savedQuery: switch (json['savedQuery']) {
      null => '',
      Object $1 => decodeString($1),
    },
    dataLabelingJob: switch (json['dataLabelingJob']) {
      null => '',
      Object $1 => decodeString($1),
    },
    dataItemFilter: switch (json['dataItemFilter']) {
      null => '',
      Object $1 => decodeString($1),
    },
    annotationsFilter: switch (json['annotationsFilter']) {
      null => '',
      Object $1 => decodeString($1),
    },
    annotationFilters: switch (json['annotationFilters']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"annotationFilters" is not a list'),
    },
    fieldMask: switch (json['fieldMask']) {
      null => null,
      Object $1 => protobuf.FieldMask.fromJson($1),
    },
    annotationsLimit: switch (json['annotationsLimit']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
    pageSize: switch (json['pageSize']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
    orderBy: switch (json['orderBy']) {
      null => '',
      Object $1 => decodeString($1),
    },
    pageToken: switch (json['pageToken']) {
      null => '',
      Object $1 => decodeString($1),
    },
  );
}