MutatingWebhookConfiguration.fromJson constructor

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

Creates a MutatingWebhookConfiguration from JSON data.

Implementation

factory MutatingWebhookConfiguration.fromJson(Map<String, dynamic> json) {
  final tempApiVersionJson = json['apiVersion'];
  final tempKindJson = json['kind'];
  final tempMetadataJson = json['metadata'];
  final tempWebhooksJson = json['webhooks'];

  final String? tempApiVersion = tempApiVersionJson;
  final String? tempKind = tempKindJson;
  final ObjectMeta? tempMetadata =
      tempMetadataJson != null ? ObjectMeta.fromJson(tempMetadataJson) : null;

  final List<MutatingWebhook>? tempWebhooks = tempWebhooksJson != null
      ? List<dynamic>.from(tempWebhooksJson)
          .map(
            (e) => MutatingWebhook.fromJson(
              Map<String, dynamic>.from(e),
            ),
          )
          .toList()
      : null;

  return MutatingWebhookConfiguration(
    apiVersion: tempApiVersion,
    kind: tempKind,
    metadata: tempMetadata,
    webhooks: tempWebhooks,
  );
}