FetchExamplesRequest.fromJson constructor

FetchExamplesRequest.fromJson(
  1. Object? j
)

Implementation

factory FetchExamplesRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return FetchExamplesRequest(
    storedContentsExampleFilter:
        switch (json['storedContentsExampleFilter']) {
          null => null,
          Object $1 => StoredContentsExampleFilter.fromJson($1),
        },
    exampleStore: switch (json['exampleStore']) {
      null => '',
      Object $1 => decodeString($1),
    },
    pageSize: switch (json['pageSize']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
    pageToken: switch (json['pageToken']) {
      null => '',
      Object $1 => decodeString($1),
    },
    exampleIds: switch (json['exampleIds']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"exampleIds" is not a list'),
    },
  );
}