toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final id = this.id;
  final permissions = this.permissions;
  final permissionsWithGrantOption = this.permissionsWithGrantOption;
  final principal = this.principal;
  final resource = this.resource;
  return {
    'Id': id,
    if (permissions != null)
      'Permissions': permissions.map((e) => e.toValue()).toList(),
    if (permissionsWithGrantOption != null)
      'PermissionsWithGrantOption':
          permissionsWithGrantOption.map((e) => e.toValue()).toList(),
    if (principal != null) 'Principal': principal,
    if (resource != null) 'Resource': resource,
  };
}