RuleWithOperations.fromJson constructor

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

Creates a RuleWithOperations from JSON data.

Implementation

factory RuleWithOperations.fromJson(Map<String, dynamic> json) {
  final tempApiGroupsJson = json['apiGroups'];
  final tempApiVersionsJson = json['apiVersions'];
  final tempOperationsJson = json['operations'];
  final tempResourcesJson = json['resources'];
  final tempScopeJson = json['scope'];

  final List<String>? tempApiGroups =
      tempApiGroupsJson != null ? List<String>.from(tempApiGroupsJson) : null;
  final List<String>? tempApiVersions = tempApiVersionsJson != null
      ? List<String>.from(tempApiVersionsJson)
      : null;
  final List<String>? tempOperations = tempOperationsJson != null
      ? List<String>.from(tempOperationsJson)
      : null;
  final List<String>? tempResources =
      tempResourcesJson != null ? List<String>.from(tempResourcesJson) : null;
  final String? tempScope = tempScopeJson;

  return RuleWithOperations(
    apiGroups: tempApiGroups,
    apiVersions: tempApiVersions,
    operations: tempOperations,
    resources: tempResources,
    scope: tempScope,
  );
}