AppsSecretCreateOptions.fromJson constructor

AppsSecretCreateOptions.fromJson(
  1. Object? json
)

Implementation

factory AppsSecretCreateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return AppsSecretCreateOptions(
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    expiresAt: map['expires_at'] == null
        ? null
        : DateTime.fromMillisecondsSinceEpoch(
            (map['expires_at'] as int).toInt()),
    name: (map['name'] as String),
    payload: (map['payload'] as String),
    scope: SecretServiceResourceScope.fromJson(map['scope']),
  );
}