Webhook.fromJson constructor

Webhook.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Webhook.fromJson(Map<String, dynamic> json) {
  return Webhook(
    branchFilter: json['branchFilter'] as String?,
    buildType: (json['buildType'] as String?)?.toWebhookBuildType(),
    filterGroups: (json['filterGroups'] as List?)
        ?.whereNotNull()
        .map((e) => (e as List)
            .whereNotNull()
            .map((e) => WebhookFilter.fromJson(e as Map<String, dynamic>))
            .toList())
        .toList(),
    lastModifiedSecret: timeStampFromJson(json['lastModifiedSecret']),
    payloadUrl: json['payloadUrl'] as String?,
    secret: json['secret'] as String?,
    url: json['url'] as String?,
  );
}