AppsSecret.fromJson constructor

AppsSecret.fromJson(
  1. Object? json
)

Implementation

factory AppsSecret.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return AppsSecret(
    created:
        DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
    deleted: map['deleted'] == null ? null : (map['deleted'] as bool),
    expiresAt: map['expires_at'] == null
        ? null
        : DateTime.fromMillisecondsSinceEpoch(
            (map['expires_at'] as int).toInt()),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    name: (map['name'] as String),
    payload: map['payload'] == null ? null : (map['payload'] as String),
    scope: SecretServiceResourceScope.fromJson(map['scope']),
  );
}