toJson method
Converts a MutatingWebhookConfiguration instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempApiVersion = apiVersion;
final tempKind = kind;
final tempMetadata = metadata;
final tempWebhooks = webhooks;
if (tempApiVersion != null) {
jsonData['apiVersion'] = tempApiVersion;
}
if (tempKind != null) {
jsonData['kind'] = tempKind;
}
if (tempMetadata != null) {
jsonData['metadata'] = tempMetadata.toJson();
}
if (tempWebhooks != null) {
jsonData['webhooks'] =
tempWebhooks.map((e) => e.toJson()).toList(growable: false);
}
return jsonData;
}