RoleBinding.fromJson constructor
Creates a RoleBinding from JSON data.
Implementation
factory RoleBinding.fromJson(Map<String, dynamic> json) {
final tempApiVersionJson = json['apiVersion'];
final tempKindJson = json['kind'];
final tempMetadataJson = json['metadata'];
final tempRoleRefJson = json['roleRef'];
final tempSubjectsJson = json['subjects'];
final String? tempApiVersion = tempApiVersionJson;
final String? tempKind = tempKindJson;
final ObjectMeta? tempMetadata =
tempMetadataJson != null ? ObjectMeta.fromJson(tempMetadataJson) : null;
final RoleRef tempRoleRef = RoleRef.fromJson(tempRoleRefJson);
final List<Subject>? tempSubjects = tempSubjectsJson != null
? List<dynamic>.from(tempSubjectsJson)
.map(
(e) => Subject.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
return RoleBinding(
apiVersion: tempApiVersion,
kind: tempKind,
metadata: tempMetadata,
roleRef: tempRoleRef,
subjects: tempSubjects,
);
}