toJson method

Map<String, Object> toJson()

Converts a LimitRange instance to JSON data.

Implementation

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

  final tempApiVersion = apiVersion;
  final tempKind = kind;
  final tempMetadata = metadata;
  final tempSpec = spec;

  if (tempApiVersion != null) {
    jsonData['apiVersion'] = tempApiVersion;
  }

  if (tempKind != null) {
    jsonData['kind'] = tempKind;
  }

  if (tempMetadata != null) {
    jsonData['metadata'] = tempMetadata.toJson();
  }

  if (tempSpec != null) {
    jsonData['spec'] = tempSpec.toJson();
  }

  return jsonData;
}