Skip to content

Commit

Permalink
fix: omit optional parameter while serializing appContext entities fi…
Browse files Browse the repository at this point in the history
…elds
  • Loading branch information
Mohit Tejani authored and Mohit Tejani committed Jan 20, 2025
1 parent c9ba9a8 commit c9b8d92
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions pubnub/lib/src/dx/objects/schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class UuidMetadataInput {
this.type});

Map<String, dynamic> toJson() => <String, dynamic>{
'name': name,
'email': email,
'custom': custom,
'externalId': externalId,
'profileUrl': profileUrl,
'status': status,
'type': type,
if (name != null) 'name': name,
if (email != null) 'email': email,
if (custom != null) 'custom': custom,
if (externalId != null) 'externalId': externalId,
if (profileUrl != null) 'profileUrl': profileUrl,
if (status != null) 'status': status,
if (type != null) 'type': type,
};
}

Expand All @@ -44,11 +44,11 @@ class ChannelMetadataInput {
{this.name, this.description, this.custom, this.status, this.type});

Map<String, dynamic> toJson() => <String, dynamic>{
'name': name,
'description': description,
'custom': custom,
'status': status,
'type': type,
if (name != null) 'name': name,
if (description != null) 'description': description,
if (custom != null) 'custom': custom,
if (status != null) 'status': status,
if (type != null) 'type': type,
};
}

Expand All @@ -65,9 +65,9 @@ class ChannelMemberMetadataInput {

Map<String, dynamic> toJson() => <String, dynamic>{
'uuid': {'id': uuid},
'custom': custom,
'status': status,
'type': type,
if (custom != null) 'custom': custom,
if (status != null) 'status': status,
if (type != null) 'type': type,
};
}

Expand All @@ -85,9 +85,9 @@ class MembershipMetadataInput {

Map<String, dynamic> toJson() => <String, dynamic>{
'channel': {'id': channelId},
'custom': custom,
'status': status,
'type': type,
if (custom != null) 'custom': custom,
if (status != null) 'status': status,
if (type != null) 'type': type,
};
}

Expand Down

0 comments on commit c9b8d92

Please sign in to comment.