toJson method

Map<String, Object> toJson()

Converts a EnvFromSource instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  final tempConfigMapRef = configMapRef;
  final tempPrefix = prefix;
  final tempSecretRef = secretRef;

  if (tempConfigMapRef != null) {
    jsonData['configMapRef'] = tempConfigMapRef.toJson();
  }

  if (tempPrefix != null) {
    jsonData['prefix'] = tempPrefix;
  }

  if (tempSecretRef != null) {
    jsonData['secretRef'] = tempSecretRef.toJson();
  }

  return jsonData;
}