RateLimits.fromJson constructor

RateLimits.fromJson(
  1. Object? j
)

Implementation

factory RateLimits.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return RateLimits(
    maxDispatchesPerSecond: switch (json['maxDispatchesPerSecond']) {
      null => 0,
      Object $1 => decodeDouble($1),
    },
    maxBurstSize: switch (json['maxBurstSize']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
    maxConcurrentDispatches: switch (json['maxConcurrentDispatches']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
  );
}