Session.fromJson constructor

Session.fromJson(
  1. Object? j
)

Implementation

factory Session.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Session(
    expireTime: switch (json['expireTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    ttl: switch (json['ttl']) {
      null => null,
      Object $1 => protobuf.Duration.fromJson($1),
    },
    name: switch (json['name']) {
      null => '',
      Object $1 => decodeString($1),
    },
    createTime: switch (json['createTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    updateTime: switch (json['updateTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    displayName: switch (json['displayName']) {
      null => '',
      Object $1 => decodeString($1),
    },
    sessionState: switch (json['sessionState']) {
      null => null,
      Object $1 => protobuf.Struct.fromJson($1),
    },
    userId: switch (json['userId']) {
      null => '',
      Object $1 => decodeString($1),
    },
  );
}